aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app.rb2
-rw-r--r--test/integration/auth_test.rb1
-rw-r--r--views/logged_in.erb1
3 files changed, 3 insertions, 1 deletions
diff --git a/app.rb b/app.rb
index ef95715..dabcf22 100644
--- a/app.rb
+++ b/app.rb
@@ -5,7 +5,7 @@ use Rack::Session::Cookie, :secret => "My session secret which shouldn't be comm
get '/' do
if session[:user]
- "Logged in with user id #{session[:user]}"
+ erb :logged_in
else
erb :index
end
diff --git a/test/integration/auth_test.rb b/test/integration/auth_test.rb
index 285fdbe..7fa2950 100644
--- a/test/integration/auth_test.rb
+++ b/test/integration/auth_test.rb
@@ -30,6 +30,7 @@ class TestAuth < CapybaraTestCase
login_with_correct_credentials
assert_equal 200, page.status_code
+ assert_text "You're logged in!"
end
def test_logout
diff --git a/views/logged_in.erb b/views/logged_in.erb
new file mode 100644
index 0000000..df9b7f4
--- /dev/null
+++ b/views/logged_in.erb
@@ -0,0 +1 @@
+You're logged in!