aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app.rb2
-rw-r--r--test/integration/auth_test.rb8
2 files changed, 9 insertions, 1 deletions
diff --git a/app.rb b/app.rb
index b4630e3..ef95715 100644
--- a/app.rb
+++ b/app.rb
@@ -17,7 +17,7 @@ post '/' do
session[:user] = 1
redirect '/'
else
- 'POST works'
+ 'Unrecognized user'
end
end
diff --git a/test/integration/auth_test.rb b/test/integration/auth_test.rb
index f5c94e4..87d1fb5 100644
--- a/test/integration/auth_test.rb
+++ b/test/integration/auth_test.rb
@@ -11,6 +11,14 @@ class TestAuth < CapybaraTestCase
assert has_selector?('//form')
end
+ def test_unrecognised_user_login
+ fill_in 'username', :with => 'unregistered'
+ fill_in 'password', :with => 'password'
+ click_button 'Login'
+
+ assert_text 'Unrecognized user'
+ end
+
def test_login
fill_in 'username', :with => 'hubertfarnsworth'
fill_in 'password', :with => 'secret'