Commit 2f0282ab authored by Imre Farkas's avatar Imre Farkas

Merge branch '228710-fj-improve-web-ide-terminalc-controller-spec' into 'master'

Improve web_ide_terminal_controller spec

Closes #228710

See merge request gitlab-org/gitlab!44313
parents 1036f80c 1120b348
...@@ -9,17 +9,20 @@ RSpec.describe Projects::WebIdeTerminalsController do ...@@ -9,17 +9,20 @@ RSpec.describe Projects::WebIdeTerminalsController do
let_it_be(:developer) { create(:user) } let_it_be(:developer) { create(:user) }
let_it_be(:reporter) { create(:user) } let_it_be(:reporter) { create(:user) }
let_it_be(:guest) { create(:user) } let_it_be(:guest) { create(:user) }
let_it_be(:project) { create(:project, :private, :repository, namespace: owner.namespace) } let_it_be(:project) do
let(:pipeline) { create(:ci_pipeline, project: project, source: :webide, config_source: :webide_source, user: user) } create(:project, :private, :repository, namespace: owner.namespace).tap do |project|
let(:job) { create(:ci_build, pipeline: pipeline, user: user, project: project) }
let(:user) { maintainer }
before do
project.add_maintainer(maintainer) project.add_maintainer(maintainer)
project.add_developer(developer) project.add_developer(developer)
project.add_reporter(reporter) project.add_reporter(reporter)
project.add_guest(guest) project.add_guest(guest)
end
end
let(:pipeline) { create(:ci_pipeline, project: project, source: :webide, config_source: :webide_source, user: user) }
let(:job) { create(:ci_build, pipeline: pipeline, user: user, project: project) }
let(:user) { maintainer }
before do
sign_in(user) sign_in(user)
end end
...@@ -158,11 +161,11 @@ RSpec.describe Projects::WebIdeTerminalsController do ...@@ -158,11 +161,11 @@ RSpec.describe Projects::WebIdeTerminalsController do
end end
context 'access rights' do context 'access rights' do
it_behaves_like 'terminal access rights' do
before do before do
subject subject
end end
end
it_behaves_like 'terminal access rights'
end end
it 'increases the web ide terminal counter' do it 'increases the web ide terminal counter' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment