Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yannick Francois
committed
Nov 3, 2012
1 parent
6a45106
commit e8313e6
Showing
7 changed files
with
53 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
require 'spec_helper' | ||
|
||
describe Feedback do | ||
before do | ||
FactoryGirl.create(:blog) | ||
end | ||
|
||
describe ".change_state!" do | ||
it "respond to change_state!" do | ||
Feedback.new.should respond_to(:change_state!) | ||
end | ||
|
||
context "given a feedback with a spam state" do | ||
it "calls mark_as_ham!" do | ||
feedback = FactoryGirl.build(:spam_comment) | ||
feedback.should_receive(:mark_as_ham) | ||
feedback.should_receive(:save!) | ||
feedback.change_state!.should eq "ham" | ||
end | ||
end | ||
|
||
context "given a feedback with a ham state" do | ||
it "calls mark_as_spam!" do | ||
feedback = FactoryGirl.build(:ham_comment) | ||
feedback.should_receive(:mark_as_spam) | ||
feedback.should_receive(:save!) | ||
feedback.change_state!.should eq "spam" | ||
end | ||
end | ||
end | ||
end |