Sha256: 34b612fb28813e9b9af19331cd60c7a615b85a16a664726e9688fd49207a45d9
Contents?: true
Size: 1.14 KB
Versions: 28
Compression:
Stored size: 1.14 KB
Contents
require 'spec_helper' describe Shoulda::Matchers::ActionController::RedirectToMatcher do context "a controller that redirects" do let(:controller) do build_response { redirect_to '/some/url' } end it "accepts redirecting to that url" do controller.should redirect_to('/some/url') end it "rejects redirecting to a different url" do controller.should_not redirect_to('/some/other/url') end it "accepts redirecting to that url in a block" do controller.should redirect_to('somewhere') { '/some/url' } end it "rejects redirecting to a different url in a block" do controller.should_not redirect_to('somewhere else') { '/some/other/url' } end end context "a controller that doesn't redirect" do let(:controller) do build_response { render :text => 'hello' } end it "rejects redirecting to a url" do controller.should_not redirect_to('/some/url') end end it "provides the correct description when provided a block" do matcher = redirect_to('somewhere else') { '/some/other/url' } matcher.description.should == 'redirect to somewhere else' end end
Version data entries
28 entries across 20 versions & 4 rubygems