2008-04-23 14:54:07 +00:00
|
|
|
require File.expand_path(File.dirname(__FILE__) + "/spec_helper")
|
2008-03-08 06:13:38 +00:00
|
|
|
|
|
|
|
RAILS_ROOT = "." unless defined?(RAILS_ROOT)
|
|
|
|
|
2008-04-23 14:54:07 +00:00
|
|
|
describe "reloads" do
|
|
|
|
before do
|
2008-03-08 06:13:38 +00:00
|
|
|
@session = ActionController::Integration::Session.new
|
|
|
|
@session.stubs(:assert_response)
|
|
|
|
@session.stubs(:get_via_redirect)
|
|
|
|
@response = mock
|
|
|
|
@session.stubs(:response).returns(@response)
|
|
|
|
@response.stubs(:body).returns("")
|
|
|
|
end
|
|
|
|
|
2008-04-27 16:45:01 +00:00
|
|
|
it "should reload the page" do
|
2008-03-08 06:13:38 +00:00
|
|
|
@session.expects(:get_via_redirect).with("/", {}).times(2)
|
|
|
|
@session.visits("/")
|
|
|
|
@session.reloads
|
|
|
|
end
|
|
|
|
|
2008-04-27 16:45:01 +00:00
|
|
|
it "should not request page if not visited any page" do
|
2008-03-08 06:13:38 +00:00
|
|
|
@session.expects(:get_via_redirect).never
|
|
|
|
@session.reloads
|
|
|
|
end
|
|
|
|
end
|