Skip to content

Commit

Permalink
adding fixtures yml and fixing broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanb committed Oct 10, 2008
1 parent 96eefb4 commit ee9b5fb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Expand Up @@ -16,6 +16,8 @@ def manifest
m.directory "app/helpers"
m.directory "app/views"
m.directory "lib"
m.directory "test"
m.directory "test/fixtures"

m.directory "app/views/#{user_plural_name}"
m.template "user.rb", "app/models/#{user_singular_name}.rb"
Expand All @@ -38,6 +40,8 @@ def manifest
m.route_name :signup, 'signup', :controller => user_plural_name, :action => 'new'

m.insert_into 'app/controllers/application.rb', 'include Authentication'

m.template "fixtures.yml", "test/fixtures/#{user_plural_name}.yml"
end
end

Expand Down
Expand Up @@ -2,13 +2,13 @@
# several methods available to all controllers and views. Here's a
# common example you might add to your application layout file.
#
# <% if logged_in? %>
# Welcome <%= current_user.username %>! Not you?
# <%= link_to "Log out", logout_path %>
# <% else %>
# <%= link_to "Sign up", signup_path %> or
# <%= link_to "log in", login_path %>.
# <% end %>
# <%% if logged_in? %>
# Welcome <%%= current_user.username %>! Not you?
# <%%= link_to "Log out", logout_path %>
# <%% else %>
# <%%= link_to "Sign up", signup_path %> or
# <%%= link_to "log in", login_path %>.
# <%% end %>
#
# You can also restrict unregistered users from accessing a controller using
# a before filter. For example.
Expand Down
2 changes: 2 additions & 0 deletions test/test_nifty_authentication_generator.rb
Expand Up @@ -44,6 +44,7 @@ class TestNiftyAuthenticationGenerator < Test::Unit::TestCase
should_generate_file 'app/helpers/sessions_helper.rb'
should_generate_file 'app/views/sessions/new.html.erb'
should_generate_file 'lib/authentication.rb'
should_generate_file 'test/fixtures/users.yml'

should "generate migration file" do
assert !Dir.glob("#{RAILS_ROOT}/db/migrate/*.rb").empty?
Expand Down Expand Up @@ -75,6 +76,7 @@ class TestNiftyAuthenticationGenerator < Test::Unit::TestCase
should_generate_file 'app/controllers/current_sessions_controller.rb'
should_generate_file 'app/helpers/current_sessions_helper.rb'
should_generate_file 'app/views/current_sessions/new.html.erb'
should_generate_file 'test/fixtures/accounts.yml'

should "generate routes" do
assert_generated_file "config/routes.rb" do |body|
Expand Down

0 comments on commit ee9b5fb

Please sign in to comment.