summaryrefslogtreecommitdiff
path: root/spec/views/shared
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 15:44:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 15:44:42 +0000
commit4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch)
tree5423a1c7516cffe36384133ade12572cf709398d /spec/views/shared
parente570267f2f6b326480d284e0164a6464ba4081bc (diff)
downloadgitlab-ce-4555e1b21c365ed8303ffb7a3325d773c9b8bf31.tar.gz
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'spec/views/shared')
-rw-r--r--spec/views/shared/nav/_sidebar.html.haml_spec.rb4
-rw-r--r--spec/views/shared/runners/_runner_details.html.haml_spec.rb (renamed from spec/views/shared/runners/show.html.haml_spec.rb)8
2 files changed, 6 insertions, 6 deletions
diff --git a/spec/views/shared/nav/_sidebar.html.haml_spec.rb b/spec/views/shared/nav/_sidebar.html.haml_spec.rb
index 268d2952683..cf9452ba68c 100644
--- a/spec/views/shared/nav/_sidebar.html.haml_spec.rb
+++ b/spec/views/shared/nav/_sidebar.html.haml_spec.rb
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe 'shared/nav/_sidebar.html.haml' do
let(:project) { build(:project, id: non_existing_record_id) }
- let(:context) { Sidebars::Projects::Context.new(current_user: nil, container: project)}
+ let(:context) { Sidebars::Projects::Context.new(current_user: nil, container: project) }
let(:sidebar) { Sidebars::Projects::Panel.new(context) }
before do
@@ -32,7 +32,7 @@ RSpec.describe 'shared/nav/_sidebar.html.haml' do
context 'when sidebar has a custom scope menu partial defined' do
it 'renders the custom partial' do
allow(sidebar).to receive(:render_raw_scope_menu_partial).and_return(scope_menu_view)
- allow(sidebar).to receive(:scope_menu).and_return(nil)
+ allow(view).to receive(:scope_menu).and_return(nil)
stub_template(scope_menu_partial => content)
render
diff --git a/spec/views/shared/runners/show.html.haml_spec.rb b/spec/views/shared/runners/_runner_details.html.haml_spec.rb
index 91a6a31daae..f9f93c8160b 100644
--- a/spec/views/shared/runners/show.html.haml_spec.rb
+++ b/spec/views/shared/runners/_runner_details.html.haml_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe 'shared/runners/show.html.haml' do
+RSpec.describe 'shared/runners/_runner_details.html.haml' do
include PageLayoutHelper
let(:runner) do
@@ -14,7 +14,7 @@ RSpec.describe 'shared/runners/show.html.haml' do
end
before do
- assign(:runner, runner)
+ allow(view).to receive(:runner) { runner }
end
subject do
@@ -24,7 +24,7 @@ RSpec.describe 'shared/runners/show.html.haml' do
describe 'Page title' do
before do
- expect_any_instance_of(PageLayoutHelper).to receive(:page_title).with("#{runner.description} ##{runner.id}", 'Runners')
+ expect(view).to receive(:page_title).with("##{runner.id} (#{runner.short_sha})")
end
it 'sets proper page title' do
@@ -147,7 +147,7 @@ RSpec.describe 'shared/runners/show.html.haml' do
context 'when runner have already contacted' do
let(:runner) { create(:ci_runner, contacted_at: DateTime.now - 6.days) }
- let(:expected_contacted_at) { I18n.localize(runner.contacted_at, format: "%b %d, %Y") }
+ let(:expected_contacted_at) { I18n.l(runner.contacted_at, format: "%b %d, %Y") }
it { is_expected.to have_content("Last contact #{expected_contacted_at}") }
end