Skip to content

Instantly share code, notes, and snippets.

@timlinquist
Created November 21, 2011 19:46
Show Gist options
  • Select an option

  • Save timlinquist/1383695 to your computer and use it in GitHub Desktop.

Select an option

Save timlinquist/1383695 to your computer and use it in GitHub Desktop.
Build creates a record for defined associations in the database
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)
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
.......
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