Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 5th, 2012  |  syntax: None  |  size: 0.51 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. rspec model attribute change not saving properly
  2. before(:each) do
  3.   @user = FactoryGirl.create(:user)
  4.   @piece = FactoryGirl.create(:piece)
  5.   @lineup = @user.lineup
  6. end
  7.  
  8. it 'should have status 'Waiting List' if the piece doesn't have available inventory' do
  9.   @piece.available_count = 0
  10.   @lineup.pieces << @piece
  11.   piece_lineup = @lineup.piece_lineups.find_by_piece_id(@piece.id)
  12.   piece_lineup.set_status
  13.   piece_lineup.status.should == 'Waiting List'
  14. end
  15.        
  16. @piece = FactoryGirl.create(:piece, :available_count => 0)