Skip to content

Commit

Permalink
sync api - spec test for not cancelling objects that aren't being syn…
Browse files Browse the repository at this point in the history
…chronized
  • Loading branch information
Tomas Strachota committed Dec 12, 2011
1 parent 9f0e3c2 commit 8ac54b6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/spec/controllers/api/sync_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,17 @@
end

it "should call cancel_sync on the object of synchronization" do
@syncable.stub(:sync_state).and_return(PulpSyncStatus::Status::RUNNING)
@syncable.should_receive(:cancel_sync)
delete :cancel, :provider_id => provider_id
end

it "should not call cancel_sync when the object is not being synchronized" do
@syncable.stub(:sync_state).and_return(PulpSyncStatus::Status::FINISHED)
@syncable.should_not_receive(:cancel_sync)
delete :cancel, :provider_id => provider_id
end

end


Expand Down

0 comments on commit 8ac54b6

Please sign in to comment.