From 21fae253dafef2d0bd63d1647a710e4c06df6f6b Mon Sep 17 00:00:00 2001 From: echarp Date: Mon, 25 Nov 2013 00:35:40 +0100 Subject: [PATCH] Meilleur gemfile et autre test, initial... --- Gemfile | 2 +- Gemfile.lock | 4 ++-- Guardfile | 29 +++++++++++------------ app/controllers/application_controller.rb | 2 +- app/views/layouts/application.html.haml | 6 ++--- test/models/user_test.rb | 6 ++--- 6 files changed, 24 insertions(+), 25 deletions(-) diff --git a/Gemfile b/Gemfile index febca142..6c380503 100644 --- a/Gemfile +++ b/Gemfile @@ -43,7 +43,7 @@ end # Use debugger # gem 'debugger', group: [:development, :test] -gem 'haml-rails', '>= 0.3.4', group: :development +gem 'haml-rails' gem 'activeadmin', github: 'gregbell/active_admin' gem 'rails-i18n' gem 'devise-i18n' diff --git a/Gemfile.lock b/Gemfile.lock index 15b15063..268aaf1a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://github.com/gregbell/active_admin.git - revision: 529bfeaa54858d2071c932eb6ddbd399832efbd9 + revision: 3a8934afb08a586099374975f210f95b43ac9e50 specs: activeadmin (1.0.0.pre) arbre (~> 1.0) @@ -236,7 +236,7 @@ DEPENDENCIES guard-bundler guard-livereload guard-test - haml-rails (>= 0.3.4) + haml-rails jbuilder jquery-rails jquery-turbolinks diff --git a/Guardfile b/Guardfile index e56ff3bf..3e51d19c 100644 --- a/Guardfile +++ b/Guardfile @@ -1,24 +1,23 @@ # A sample Guardfile # More info at https://github.com/guard/guard#readme +guard :test do + watch(%r{^test/.+_test\.rb$}) + watch('test/test_helper.rb') { 'test' } + + # Rails 4 + watch(%r{^app/(.+)\.rb}) { |m| "test/#{m[1]}_test.rb" } + watch(%r{^app/controllers/application_controller\.rb}) { 'test/controllers' } + watch(%r{^app/controllers/(.+)_controller\.rb}) { |m| "test/integration/#{m[1]}_test.rb" } + watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" } + watch(%r{^lib/(.+)\.rb}) { |m| "test/lib/#{m[1]}_test.rb" } +end + guard :livereload do - watch(%r{app/views/.+\.(erb|haml|slim)}) + watch(%r{app/views/.+\.(erb|haml|slim)$}) watch(%r{app/helpers/.+\.rb}) watch(%r{public/.+\.(css|js|html)}) watch(%r{config/locales/.+\.yml}) # Rails Assets Pipeline - watch(%r{(app|vendor)/assets/\w+/(.+\.(css|js|html)).*}) { |m| "/assets/#{m[2]}" } -end - -guard :test do - watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" } - watch(%r{^test/.+_test\.rb$}) - watch('test/test_helper.rb') { "test" } - - # Rails example - watch(%r{^app/models/(.+)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" } - watch(%r{^app/controllers/(.+)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" } - watch(%r{^app/views/.+\.rb$}) { "test/integration" } - watch(%r{^app/views/.+\.haml$}) { "test/integration" } - watch('app/controllers/application_controller.rb') { ["test/functional", "test/integration"] } + watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html))).*}) { |m| "/assets/#{m[3]}" } end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6c0dc609..13dcade3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,5 +3,5 @@ class ApplicationController < ActionController::Base # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception - before_action :authenticate_admin_user! + #before_action :authenticate_admin_user! end diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 273abdc4..7271f62e 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -34,9 +34,9 @@ %header.top %h1= link_to 'Agenda du libre', root_url - - if admin_user_signed_in? - - else - = link_to t('.login'), new_user_session_path, class: :login + //- if admin_user_signed_in? + //- else + // = link_to t('.login'), new_user_session_path, class: :login = yield diff --git a/test/models/user_test.rb b/test/models/user_test.rb index 82f61e01..cec65f21 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -1,7 +1,7 @@ require 'test_helper' class UserTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end + test "the truth" do + assert true + end end