step "the list is marked as in need of help" do @list.needs_help.should_not be_true @list.needs_help! end step "the list is marked as in need of payment" do @list.needs_payment! end step "the user has an active list" do @list = create :list, supplier: @supplier, table: @table, user_ids: [@user.id] @user.reload @user.active_list_id = @list.id @user.save end step "the list should be marked as closed" do @list.reload @list.state.should == 'closed' end step 'a new order on a table in another section is created' do @new_section = create :section, title: 'Terrace', supplier: @supplier @new_table = create :table, number: 59, section: @new_section, supplier: @supplier @new_list = create :list, section: @new_section, table: @new_table, supplier: @supplier, user_ids: [@user.id] @new_order = @new_list.place_order @user, {@product.id => 3} end step "I am signed in as a user" do step "I visit the user obtain token path" end step "the other user should be added to the active list" do @other_user.reload @list.reload @other_user.active_list_id.should == @list.id @list.user_ids.should =~ [@user.id, @other_user.id] end step "the other user should not be added to the active list" do @other_user.reload @list.reload @other_user.active_list_id.should be_nil @list.user_ids.should == [@user.id] end