Apply review suggestions from @nilsding
Co-authored-by: Georg Gadinger <nilsding@nilsding.org>
This commit is contained in:
parent
c4d01a4f74
commit
866894563e
|
@ -61,7 +61,7 @@ describe UserController, type: :controller do
|
||||||
expect(response).to render_template("user/questions")
|
expect(response).to render_template("user/questions")
|
||||||
end
|
end
|
||||||
|
|
||||||
context "current user signed in" do
|
context "when the current user is the question author" do
|
||||||
before do
|
before do
|
||||||
sign_in user
|
sign_in user
|
||||||
end
|
end
|
||||||
|
@ -72,7 +72,7 @@ describe UserController, type: :controller do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "user signed in" do
|
context "when the current user is someone else" do
|
||||||
let(:another_user) { FactoryBot.create :user }
|
let(:another_user) { FactoryBot.create :user }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
@ -85,7 +85,7 @@ describe UserController, type: :controller do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "moderator unmasked" do
|
context "when a moderator uses unmask" do
|
||||||
let(:another_user) { FactoryBot.create :user, roles: ["moderator"] }
|
let(:another_user) { FactoryBot.create :user, roles: ["moderator"] }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
@ -99,7 +99,7 @@ describe UserController, type: :controller do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "user not signed in" do
|
context "when user is not signed in" do
|
||||||
it "contains no questions" do
|
it "contains no questions" do
|
||||||
subject
|
subject
|
||||||
expect(assigns(:questions).size).to eq(0)
|
expect(assigns(:questions).size).to eq(0)
|
||||||
|
|
Loading…
Reference in New Issue