summaryrefslogtreecommitdiff
path: root/spec/models/external_pull_request_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/external_pull_request_spec.rb')
-rw-r--r--spec/models/external_pull_request_spec.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/models/external_pull_request_spec.rb b/spec/models/external_pull_request_spec.rb
index e0822fc177a..bac2c369d7d 100644
--- a/spec/models/external_pull_request_spec.rb
+++ b/spec/models/external_pull_request_spec.rb
@@ -3,7 +3,8 @@
require 'spec_helper'
RSpec.describe ExternalPullRequest do
- let(:project) { create(:project) }
+ let_it_be(:project) { create(:project, :repository) }
+
let(:source_branch) { 'the-branch' }
let(:status) { :open }
@@ -217,4 +218,18 @@ RSpec.describe ExternalPullRequest do
expect(pull_request).not_to be_from_fork
end
end
+
+ describe '#modified_paths' do
+ let(:pull_request) do
+ build(:external_pull_request, project: project, target_sha: '281d3a7', source_sha: '498214d')
+ end
+
+ subject(:modified_paths) { pull_request.modified_paths }
+
+ it 'returns modified paths' do
+ expect(modified_paths).to eq ['bar/branch-test.txt',
+ 'files/js/commit.coffee',
+ 'with space/README.md']
+ end
+ end
end