Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #track_spec.rb
- describe Track, "destroy" do
- context "copyright disputes" do
- it "should change the status of its copyright dispute" do
- Fingerprint::Dispute.create! :track => tracks(:tiga_private), :user => users(:tiga), :user_message => "OHAI"
- lambda { tracks(:tiga_private).log_and_destroy }.should change(tracks(:tiga_private).dispute, :state).from("pending").to("rejected")
- end
- it "should add text to the dispute's message" do
- track = tracks(:tiga_private)
- Fingerprint::Dispute.create! :track => track, :user => users(:tiga), :user_message => "OHAI"
- lambda { track.log_and_destroy }.should change(track.dispute, :user_message).from("OHAI") # Acts weird…
- end
- end
- end
- # The method that it's supposed to be testing
- def reject_dispute
- if self.dispute
- self.dispute.state = "rejected"
- self.dispute.user_message << "\n\n <em>* Notice: This dispute was automatically rejected because the corrosponding track or user has been deleted</em>*"
- end
- end
Add Comment
Please, Sign In to add comment