Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1a99f59187
Fetching contributors…

Cannot retrieve contributors at this time

50 lines (40 sloc) 1.38 kb
require "spec_helper"
module RSpec::Rails
describe ControllerExampleGroup do
it { should be_included_in_files_in('./spec/controllers/') }
it { should be_included_in_files_in('.\\spec\\controllers\\') }
it "includes routing matchers" do
group = RSpec::Core::ExampleGroup.describe do
include ControllerExampleGroup
end
group.included_modules.should include(RSpec::Rails::Matchers::RoutingMatchers)
end
it "adds :type => :controller to the metadata" do
group = RSpec::Core::ExampleGroup.describe do
include ControllerExampleGroup
end
group.metadata[:type].should eq(:controller)
end
it "should use the controller as the implicit subject" do
group = RSpec::Core::ExampleGroup.describe do
include ControllerExampleGroup
end
example = group.new
controller = double('controller')
example.stub(:controller => controller)
example.subject.should == controller
end
describe "with a specified subject" do
before do
@group = RSpec::Core::ExampleGroup.describe do
include ControllerExampleGroup
subject { 'specified' }
end
end
it "should use the specified subject instead of the controller" do
example = @group.new
example.subject.should == 'specified'
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.