added logout specs
This commit is contained in:
Родитель
5097095237
Коммит
223e76b00b
|
@ -69,14 +69,26 @@ describe CASServer do
|
||||||
|
|
||||||
end # describe '/login'
|
end # describe '/login'
|
||||||
|
|
||||||
|
|
||||||
describe '/logout' do
|
describe '/logout' do
|
||||||
|
|
||||||
|
before do
|
||||||
|
@target_service = 'http://my.app.test'
|
||||||
|
end
|
||||||
|
|
||||||
it "logs out successfully" do
|
it "logs out successfully" do
|
||||||
# capybara doesn't let us post directly :(
|
# capybara doesn't let us post directly :(
|
||||||
Capybara.current_session.driver.post '/logout'
|
#Capybara.current_session.driver.post '/logout'
|
||||||
puts page.body
|
visit "/logout"
|
||||||
|
|
||||||
page.should have_content("You have successfully logged out")
|
page.should have_content("You have successfully logged out")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "logs out successfully and redirects to target service" do
|
||||||
|
visit "/logout?gateway=true&service="+CGI.escape(@target_service)
|
||||||
|
|
||||||
|
page.current_url.should =~ /^#{Regexp.escape(@target_service)}\/?/
|
||||||
|
end
|
||||||
|
|
||||||
end # describe '/logout'
|
end # describe '/logout'
|
||||||
end
|
end
|
||||||
|
|
Загрузка…
Ссылка в новой задаче