Created
November 21, 2011 19:46
-
-
Save timlinquist/1383695 to your computer and use it in GitHub Desktop.
Build creates a record for defined associations in the database
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
| bundle exec rspec spec/models/client_spec.rb -l 14 | |
| Run filtered including {:line_number=>14} | |
| F | |
| Failures: | |
| 1) Client should not create the associated object (industry) | |
| Failure/Error: lambda{ | |
| count should not have changed, but did change from 4 to 5 | |
| # ./spec/models/client_spec.rb:15 | |
| Finished in 0.5157 seconds | |
| 1 example, 1 failure | |
| Failed examples: | |
| rspec ./spec/models/client_spec.rb:14 # Client should not create the associated object (industry) | |
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
| FactoryGirl.define do | |
| factory :client do | |
| branded_name "United Stor-All" | |
| client_name "United Stor-All" | |
| layout 'unitedstorage' | |
| platform_version "3.0" | |
| url 'http://www.unitedstorall.com' | |
| default_call_plan_id 1 | |
| industry | |
| ....... |
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
| it "should not create the associated object (industry)" do | |
| lambda{ | |
| build :client | |
| }.should_not change(Industry, :count).by(1) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment