Skip to content

Commit

Permalink
Fix a couple of small bugs in test templates.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxim committed Sep 10, 2009
1 parent dafd64f commit ca5fb51
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions lark_template.rb
Expand Up @@ -505,6 +505,7 @@ def install_rails (options)
extra_notifier_test = ""
if require_activation
extra_notifier_test = load_snippet('extra_notifier_test', 'require_activation')
extra_notifier_test.sub!('#{notifier_email_from}', notifier_email_from)
end

file 'test/unit/notifier_test.rb', load_pattern('test/unit/notifier_test.rb', 'default', binding)
Expand Down
8 changes: 4 additions & 4 deletions patterns/default/test/integration/user_can_login_test.rb
Expand Up @@ -4,19 +4,19 @@ class UserCanLoginTest < ActionController::IntegrationTest

context 'an existing user' do
setup do
#{make_user_block}
#{generate_user_block}
end

should 'be able to login with valid id and password' do
visit login_path

fill_in 'Login', :with => @user.login
fill_in 'Password', :with => @user.password
fill_in 'Login', :with => @the_user.login
fill_in 'Password', :with => @the_user.password

click_button 'Login'

assert_equal '/', path
assert_contain "Login successful!"
assert_contain I18n.t('flash.user_sessions.create.notice')
end
end
end
8 changes: 4 additions & 4 deletions patterns/default/test/integration/user_can_logout_test.rb
Expand Up @@ -4,10 +4,10 @@ class UserCanLogoutTest < ActionController::IntegrationTest

context 'a logged-in user' do
setup do
#{make_user_block}
#{generate_user_block}
visit login_path
fill_in 'Login', :with => @user.login
fill_in 'Password', :with => @user.password
fill_in 'Login', :with => @the_user.login
fill_in 'Password', :with => @the_user.password
click_button 'Login'
end

Expand All @@ -17,7 +17,7 @@ class UserCanLogoutTest < ActionController::IntegrationTest
click_link "Logout"

assert_equal new_user_session_path, path
assert_contain "Logout successful!"
assert_contain I18n.t('flash.user_sessions.destroy.notice')
end
end
end
2 changes: 1 addition & 1 deletion snippets/require_activation/extra_notifier_test
Expand Up @@ -3,7 +3,7 @@
Notifier.deliver_activation_instructions(user)
assert_sent_email do |email|
email.subject = "Activation Instructions"
email.from.include?('Lark Group <noreply@larkfarm.com>')
email.from.include?('#{notifier_email_from}')
email.to.include?(user.email)
email.body =~ Regexp.new(user.perishable_token)
end
Expand Down

0 comments on commit ca5fb51

Please sign in to comment.