diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-04-21 16:13:40 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-04-24 13:29:36 +0300 |
commit | 8ed7ac9d443563a62a6aa03a2ec72b9fcb0d2df1 (patch) | |
tree | b787add194486ac4346c2de2874b32db6d37c635 /spec/lib | |
parent | 84a1590252c63c710bceaa7a394799cdc5109505 (diff) |
Use project.commit convenience method.
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/diff/file_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/diff/parser_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb | 8 | ||||
-rw-r--r-- | spec/lib/gitlab/markdown/commit_reference_filter_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/reference_extractor_spec.rb | 6 |
5 files changed, 11 insertions, 11 deletions
diff --git a/spec/lib/gitlab/diff/file_spec.rb b/spec/lib/gitlab/diff/file_spec.rb index 40eb45e37ca..8b7946f3117 100644 --- a/spec/lib/gitlab/diff/file_spec.rb +++ b/spec/lib/gitlab/diff/file_spec.rb @@ -4,7 +4,7 @@ describe Gitlab::Diff::File do include RepoHelpers let(:project) { create(:project) } - let(:commit) { project.repository.commit(sample_commit.id) } + let(:commit) { project.commit(sample_commit.id) } let(:diff) { commit.diffs.first } let(:diff_file) { Gitlab::Diff::File.new(diff) } diff --git a/spec/lib/gitlab/diff/parser_spec.rb b/spec/lib/gitlab/diff/parser_spec.rb index 918f6d0ead4..4d5d1431683 100644 --- a/spec/lib/gitlab/diff/parser_spec.rb +++ b/spec/lib/gitlab/diff/parser_spec.rb @@ -4,7 +4,7 @@ describe Gitlab::Diff::Parser do include RepoHelpers let(:project) { create(:project) } - let(:commit) { project.repository.commit(sample_commit.id) } + let(:commit) { project.commit(sample_commit.id) } let(:diff) { commit.diffs.first } let(:parser) { Gitlab::Diff::Parser.new } diff --git a/spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb b/spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb index 5ebdc8926e2..f0804ce0056 100644 --- a/spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb +++ b/spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb @@ -5,8 +5,8 @@ module Gitlab::Markdown include ReferenceFilterSpecHelper let(:project) { create(:project) } - let(:commit1) { project.repository.commit } - let(:commit2) { project.repository.commit("HEAD~2") } + let(:commit1) { project.commit } + let(:commit2) { project.commit("HEAD~2") } it 'requires project context' do expect { described_class.call('Commit Range 1c002d..d200c1', {}) }. @@ -86,8 +86,8 @@ module Gitlab::Markdown context 'cross-project reference' do let(:namespace) { create(:namespace, name: 'cross-reference') } let(:project2) { create(:project, namespace: namespace) } - let(:commit1) { project.repository.commit } - let(:commit2) { project.repository.commit("HEAD~2") } + let(:commit1) { project.commit } + let(:commit2) { project.commit("HEAD~2") } let(:reference) { "#{project2.path_with_namespace}@#{commit1.id}...#{commit2.id}" } context 'when user can access reference' do diff --git a/spec/lib/gitlab/markdown/commit_reference_filter_spec.rb b/spec/lib/gitlab/markdown/commit_reference_filter_spec.rb index 71fd2db2c58..f792d7f696e 100644 --- a/spec/lib/gitlab/markdown/commit_reference_filter_spec.rb +++ b/spec/lib/gitlab/markdown/commit_reference_filter_spec.rb @@ -5,7 +5,7 @@ module Gitlab::Markdown include ReferenceFilterSpecHelper let(:project) { create(:project) } - let(:commit) { project.repository.commit } + let(:commit) { project.commit } it 'requires project context' do expect { described_class.call('Commit 1c002d', {}) }. @@ -80,7 +80,7 @@ module Gitlab::Markdown context 'cross-project reference' do let(:namespace) { create(:namespace, name: 'cross-reference') } let(:project2) { create(:project, namespace: namespace) } - let(:commit) { project.repository.commit } + let(:commit) { project.commit } let(:reference) { "#{project2.path_with_namespace}@#{commit.id}" } context 'when user can access reference' do diff --git a/spec/lib/gitlab/reference_extractor_spec.rb b/spec/lib/gitlab/reference_extractor_spec.rb index 6fba140f69d..0f4ea2a24ed 100644 --- a/spec/lib/gitlab/reference_extractor_spec.rb +++ b/spec/lib/gitlab/reference_extractor_spec.rb @@ -125,7 +125,7 @@ describe Gitlab::ReferenceExtractor do end it 'accesses valid commits' do - commit = project.repository.commit('master') + commit = project.commit('master') subject.analyze("this references commits #{commit.sha[0..6]} and 012345") extracted = subject.commits @@ -135,8 +135,8 @@ describe Gitlab::ReferenceExtractor do end it 'accesses valid commit ranges' do - commit = project.repository.commit('master') - earlier_commit = project.repository.commit('master~2') + commit = project.commit('master') + earlier_commit = project.commit('master~2') subject.analyze("this references commits #{earlier_commit.sha[0..6]}...#{commit.sha[0..6]}") extracted = subject.commit_ranges |