Last active
December 18, 2015 00:59
-
-
Save stevenheidel/5700638 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 'foo' do | |
let(:concert) { FactoryGirl.create :concert } # Creates a concert with name 'default' | |
before do | |
Foo.bar(concert.id) | |
end | |
describe '.bar' do | |
it 'should be baz' do | |
concert.name.should == 'baz' # Fails | |
puts concert.name #=> 'default' | |
end | |
end | |
end | |
# elsewhere... | |
class Foo | |
def self.bar(concert_id) | |
concert = Concert.find_by_id(concert_id) | |
concert.name = 'baz' | |
concert.save | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment