Last active
December 18, 2015 08:19
-
-
Save GCorbel/5753042 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe PaintingsController do | |
let!(:painting) { build_stubbed(:painting) } | |
before do | |
Painting.stub(:new).and_return(painting) | |
end | |
describe "POST 'create'" do | |
subject { get 'create' } | |
context "when the painting is valid" do | |
before { painting.stub(:save).and_return(true) } | |
it { should render_template('contract') } | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe PaintingsController do | |
let!(:painting) { build_stubbed(:painting) } | |
before do | |
Painting.stub(:new).and_return(painting) | |
painting.stub(:save).and_return(true) | |
end | |
describe "POST 'create'" do | |
subject { get 'create' } | |
context "when the painting is valid" do | |
it { should render_template('contract') } | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Failure/Error: before { painting.stub(:valid?).and_return(true) } | |
NameError: | |
undefined local variable or method ` painting' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1::Nested_1:0x007fb7acbe5cb0> | |
# ./spec/controllers/painting_controller_spec.rb:10:in `block (4 levels) in <top (required)>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment