Browse Source

Meilleur gemfile et autre test, initial...

recurrent
echarp 9 years ago
parent
commit
21fae253da
  1. 2
      Gemfile
  2. 4
      Gemfile.lock
  3. 29
      Guardfile
  4. 2
      app/controllers/application_controller.rb
  5. 6
      app/views/layouts/application.html.haml
  6. 6
      test/models/user_test.rb

2
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'

4
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

29
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

2
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

6
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

6
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

Loading…
Cancel
Save