aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/question_spec.rb')
-rw-r--r--spec/models/question_spec.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/models/question_spec.rb b/spec/models/question_spec.rb
index 0489be4..5dddd70 100644
--- a/spec/models/question_spec.rb
+++ b/spec/models/question_spec.rb
@@ -66,10 +66,10 @@ describe Question do
end
it "should send email notifications to watching recruits when created by recruiter" do
- category = Factory(:question_category)
- recruit = Factory(:recruit, :question_categories => [category])
+ category = Factory(:category)
+ recruit = Factory(:recruit, :categories => [category])
question = Question.new(:title => "new question",
- :question_category => category)
+ :category => category)
UserMailer.should_receive_delayed(:deliver_new_question, recruit, question)
@@ -77,10 +77,10 @@ describe Question do
end
it "should send email notifications to watching recruits when approved" do
- category = Factory(:question_category)
- recruit = Factory(:recruit, :question_categories => [category])
+ category = Factory(:category)
+ recruit = Factory(:recruit, :categories => [category])
question = Factory(:question, :title => "new question",
- :question_category => category, :user => Factory(:recruit))
+ :category => category, :user => Factory(:recruit))
UserMailer.should_receive_delayed(:deliver_new_question, recruit, question)
question.approved = true
@@ -88,10 +88,10 @@ describe Question do
end
it "should not send email notifications to watching recruits when approved is changed" do
- category = Factory(:question_category)
- recruit = Factory(:recruit, :question_categories => [category])
+ category = Factory(:category)
+ recruit = Factory(:recruit, :categories => [category])
question = Factory(:question, :title => "new question",
- :question_category => category, :user => Factory(:recruit), :approved => true)
+ :category => category, :user => Factory(:recruit), :approved => true)
UserMailer.should_not_receive(:deliver_new_question).with(recruit, question)
@@ -146,7 +146,7 @@ describe Question do
question.should be_editable_by(recruit)
question.should be_editable_by(recruit, :title)
question.should be_editable_by(recruit, :documentation)
- question.should be_editable_by(recruit, :question_category)
+ question.should be_editable_by(recruit, :category)
question.should_not be_editable_by(recruit, :user)
question.should_not be_editable_by(recruit, :approved)
@@ -159,7 +159,7 @@ describe Question do
question.should be_editable_by(recruit)
question.should be_editable_by(recruit, :title)
question.should be_editable_by(recruit, :documentation)
- question.should be_editable_by(recruit, :question_category)
+ question.should be_editable_by(recruit, :category)
question.should_not be_editable_by(recruit, :user)
question.should_not be_editable_by(recruit, :approved)
@@ -172,7 +172,7 @@ describe Question do
question.should be_editable_by(admin)
question.should be_editable_by(admin, :title)
question.should be_editable_by(admin, :documentation)
- question.should be_editable_by(admin, :question_category)
+ question.should be_editable_by(admin, :category)
question.should be_editable_by(admin, :approved)
question.should_not be_editable_by(admin, :user)