Remove mock that was breaking tests
This commit is contained in:
parent
d1a5d8ea62
commit
46d2e17194
|
@ -26,18 +26,16 @@ describe GroupsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "counts" do
|
describe "counts" do
|
||||||
it "ensures the group can be seen" do
|
it "returns counts if it can be seen" do
|
||||||
Guardian.any_instance.expects(:can_see?).with(group).returns(false)
|
|
||||||
xhr :get, :counts, group_id: group.name
|
|
||||||
expect(response).not_to be_success
|
|
||||||
end
|
|
||||||
|
|
||||||
it "performs the query and responds with JSON" do
|
|
||||||
Guardian.any_instance.expects(:can_see?).with(group).returns(true)
|
|
||||||
Group.any_instance.expects(:posts_for).returns(Group.none)
|
|
||||||
xhr :get, :counts, group_id: group.name
|
xhr :get, :counts, group_id: group.name
|
||||||
expect(response).to be_success
|
expect(response).to be_success
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "returns no counts if it can not be seen" do
|
||||||
|
group.update_columns(visible: false)
|
||||||
|
xhr :get, :counts, group_id: group.name
|
||||||
|
expect(response).not_to be_success
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "posts" do
|
describe "posts" do
|
||||||
|
|
Loading…
Reference in New Issue