oh well, touching Capybara.app_host resets the session

This commit is contained in:
Jonne Hass 2011-12-10 20:53:19 +01:00
parent 8f13f2182e
commit 559016af7e
3 changed files with 11 additions and 3 deletions

View file

@ -26,6 +26,7 @@ Feature: oauth
And I should have 1 user on Chubbies
Scenario: Signing up as a user while someone else is logged into Diaspora
When I change the app_host to Diaspora
Given a user with username "alice"
When I sign in as "alice@alice.alice"
Then I visit "/new" on Chubbies
@ -55,6 +56,7 @@ Feature: oauth
Given Chubbies is registered on my pod
When I try to authorize Chubbies
And I visit "/reset" on Chubbies
And I change the app_host to Diaspora
And I go to the destroy user session page
When I try to authorize Chubbies
@ -70,6 +72,7 @@ Feature: oauth
When I press "Authorize"
And I change the app_host to Diaspora
And I am on the authorizations page
Then I should see "Chubbies"
And I should see "The best way to chub."
@ -79,6 +82,7 @@ Feature: oauth
When I press "Authorize"
And I change the app_host to Diaspora
And I am on the authorizations page
And I preemptively confirm the alert
And I follow "Revoke Access"

View file

@ -1,4 +1,5 @@
When 'I debug' do
require 'ruby-debug'
debugger
true
end

View file

@ -56,10 +56,12 @@ And /^I should have (\d) user on Chubbies$/ do |num|
end
When /^I visit "([^"]+)" on Chubbies$/ do |path|
former_host = Capybara.app_host
Capybara.app_host = "localhost:#{Chubbies::PORT}"
Capybara.app_host = "http://localhost:#{Chubbies::PORT}"
visit(path)
Capybara.app_host = former_host
end
When /^I change the app_host to Diaspora$/ do
Capybara.app_host = "http://localhost:9887"
end
class Chubbies
@ -114,3 +116,4 @@ class Chubbies
end
end
end