0
@@ -114,6 +114,78 @@ describe User, "#post for admins" do
0
+module TopicUpdatePostHelper
0
+ def self.included(base)
0
+ @user = users(:default)
0
+ @topic = topics(:default)
0
+ @attributes = {:body => 'booya'}
0
+ @user.revise @topic, @attributes
0
+describe User, "#revise(topic) for users" do
0
+ include TopicUpdatePostHelper
0
+ it "ignores sticky bit" do
0
+ @attributes[:sticky] = 1
0
+ @topic.should_not be_sticky
0
+ it "ignores locked bit" do
0
+ @attributes[:locked] = true
0
+ @topic.should_not be_locked
0
+describe User, "#revise(topic) for moderators" do
0
+ include TopicUpdatePostHelper
0
+ @user.stub!(:moderator_of?).and_return(true)
0
+ it "sets sticky bit" do
0
+ @attributes[:sticky] = 1
0
+ @topic.should be_sticky
0
+ it "sets locked bit" do
0
+ @attributes[:locked] = true
0
+ @topic.should be_locked
0
+describe User, "#revise(topic) for admins" do
0
+ include TopicUpdatePostHelper
0
+ it "sets sticky bit" do
0
+ @attributes[:sticky] = 1
0
+ @topic.should be_sticky
0
+ it "sets locked bit" do
0
+ @attributes[:locked] = true
0
+ @topic.should be_locked
0
describe User, "#reply" do
Comments
No one has commented yet.