mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
fix the build (460243d7
)
This commit is contained in:
parent
c1d09be3cf
commit
b6febb0638
1 changed files with 2 additions and 1 deletions
|
@ -13,6 +13,7 @@ describe TopicView do
|
||||||
expect { TopicView.new(1231232, coding_horror) }.to raise_error(Discourse::NotFound)
|
expect { TopicView.new(1231232, coding_horror) }.to raise_error(Discourse::NotFound)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# see also spec/controllers/topics_controller_spec.rb TopicsController::show::permission errors
|
||||||
it "raises an error if the user can't see the topic" do
|
it "raises an error if the user can't see the topic" do
|
||||||
Guardian.any_instance.expects(:can_see?).with(topic).returns(false)
|
Guardian.any_instance.expects(:can_see?).with(topic).returns(false)
|
||||||
expect { topic_view }.to raise_error(Discourse::InvalidAccess)
|
expect { topic_view }.to raise_error(Discourse::InvalidAccess)
|
||||||
|
@ -21,7 +22,7 @@ describe TopicView do
|
||||||
it "handles deleted topics" do
|
it "handles deleted topics" do
|
||||||
admin = Fabricate(:admin)
|
admin = Fabricate(:admin)
|
||||||
topic.trash!(admin)
|
topic.trash!(admin)
|
||||||
expect { TopicView.new(topic.id, Fabricate(:user)) }.to raise_error(Discourse::NotFound)
|
expect { TopicView.new(topic.id, Fabricate(:user)) }.to raise_error(Discourse::InvalidAccess)
|
||||||
expect { TopicView.new(topic.id, admin) }.not_to raise_error
|
expect { TopicView.new(topic.id, admin) }.not_to raise_error
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue