diff options
-rw-r--r-- | spec/gitlab/docs/link_spec.rb | 8 | ||||
-rw-r--r-- | spec/gitlab/navigation_spec.rb | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/spec/gitlab/docs/link_spec.rb b/spec/gitlab/docs/link_spec.rb index 18878be9..4484936e 100644 --- a/spec/gitlab/docs/link_spec.rb +++ b/spec/gitlab/docs/link_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Gitlab::Docs::Link do - let(:page) { double('page') } + let(:page) { instance_double(Gitlab::Docs::Page) } let(:href) { '../some/page.html#some-anchor' } subject { described_class.new(href, page) } @@ -98,7 +98,7 @@ describe Gitlab::Docs::Link do context 'when the link is an external link' do let(:href) { '../some/page.html#my-anchor' } - let(:destination) { double('destination') } + let(:destination) { instance_double(Gitlab::Docs::Page) } before do allow(page).to receive(:directory).and_return('/my/docs/page') @@ -126,7 +126,7 @@ describe Gitlab::Docs::Link do before do allow(page).to receive(:directory).and_return('/my/dir') allow(subject).to receive(:destination_file) - .and_return(double('page', exists?: false)) + .and_return(instance_double(Gitlab::Docs::Page, exists?: false)) end it 'returns false if page does not exist' do @@ -138,7 +138,7 @@ describe Gitlab::Docs::Link do before do allow(page).to receive(:directory).and_return('/my/dir') allow(subject).to receive(:destination_file) - .and_return(double('page', has_anchor?: false)) + .and_return(instance_double(Gitlab::Docs::Page, has_anchor?: false)) end it 'returns false if anchor does not exist' do diff --git a/spec/gitlab/navigation_spec.rb b/spec/gitlab/navigation_spec.rb index 892d4486..36e1b132 100644 --- a/spec/gitlab/navigation_spec.rb +++ b/spec/gitlab/navigation_spec.rb @@ -8,7 +8,7 @@ require 'gitlab/navigation/section' describe Gitlab::Navigation do subject(:navigation) { described_class.new(items, item) } - let(:item) { double(path: '/omnibus/user/README.html', identifier: double(to_s: '/omnibus/user/README.md')) } + let(:item) { instance_double(Nanoc::Core::CompilationItemView, path: '/omnibus/user/README.html', identifier: instance_double(Nanoc::Core::Identifier, to_s: '/omnibus/user/README.md')) } let(:items) do { '/_data/navigation.yaml' => { sections: [Gitlab::Navigation::Section.new(section_title: 'Default Section')] } @@ -19,7 +19,7 @@ describe Gitlab::Navigation do subject { navigation.nav_items } context 'when yaml configuration for project does not exist' do - let(:item) { double(path: '/ee/user/README.html', identifier: double(to_s: '/ee/user/README.md')) } + let(:item) { instance_double(Nanoc::Core::CompilationItemView, path: '/ee/user/README.html', identifier: instance_double(Nanoc::Core::Identifier, to_s: '/ee/user/README.md')) } it 'returns default sections' do sections = subject[:sections] @@ -39,7 +39,7 @@ describe Gitlab::Navigation do it { is_expected.to eq('/omnibus/user/README.html') } context 'when yaml configuration for project does not exist' do - let(:item) { double(path: '/ee/user/README.html', identifier: double(to_s: '/ee/user/README.md')) } + let(:item) { instance_double(Nanoc::Core::CompilationItemView, path: '/ee/user/README.html', identifier: instance_double(Nanoc::Core::Identifier, to_s: '/ee/user/README.md')) } it { is_expected.to eq('/omnibus/user/README.html') } end |