提交 d91c5bee 编写于 作者: R Rémy Coutable

Merge branch 'environment-specs-for-ee' into 'master'

Fix Environment terminal specs for EE

See merge request gitlab-org/gitlab-ce!23421
...@@ -217,7 +217,10 @@ describe Projects::EnvironmentsController do ...@@ -217,7 +217,10 @@ describe Projects::EnvironmentsController do
end end
it 'loads the terminals for the environment' do it 'loads the terminals for the environment' do
expect_any_instance_of(Environment).to receive(:terminals) # In EE we have to stub EE::Environment since it overwrites the
# "terminals" method.
expect_any_instance_of(defined?(EE) ? EE::Environment : Environment)
.to receive(:terminals)
get :terminal, environment_params get :terminal, environment_params
end end
...@@ -240,7 +243,9 @@ describe Projects::EnvironmentsController do ...@@ -240,7 +243,9 @@ describe Projects::EnvironmentsController do
context 'and valid id' do context 'and valid id' do
it 'returns the first terminal for the environment' do it 'returns the first terminal for the environment' do
expect_any_instance_of(Environment) # In EE we have to stub EE::Environment since it overwrites the
# "terminals" method.
expect_any_instance_of(defined?(EE) ? EE::Environment : Environment)
.to receive(:terminals) .to receive(:terminals)
.and_return([:fake_terminal]) .and_return([:fake_terminal])
......
...@@ -165,8 +165,14 @@ describe 'Environment' do ...@@ -165,8 +165,14 @@ describe 'Environment' do
context 'web terminal', :js do context 'web terminal', :js do
before do before do
# Stub #terminals as it causes js-enabled feature specs to render the page incorrectly # Stub #terminals as it causes js-enabled feature specs to
allow_any_instance_of(Environment).to receive(:terminals) { nil } # render the page incorrectly
#
# In EE we have to stub EE::Environment since it overwrites
# the "terminals" method.
allow_any_instance_of(defined?(EE) ? EE::Environment : Environment)
.to receive(:terminals) { nil }
visit terminal_project_environment_path(project, environment) visit terminal_project_environment_path(project, environment)
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册