Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-14 00:08:59 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-14 00:08:59 +0300
commitd466ee5042520ad078fe050cb078d81dc2ebe196 (patch)
tree5648eb1aee8aeff5b5c5ff4669a184fd7676f778 /spec/models
parent6a9d7c009e4e5975a89bcc3e458da4b3ec484bd1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/project_spec.rb17
-rw-r--r--spec/models/repository_spec.rb8
2 files changed, 25 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 5c56d1aa757..79d9e42666c 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -1980,6 +1980,23 @@ describe Project do
expect(project.reload.import_url).to eq('http://test.com')
end
+
+ it 'saves the url credentials percent decoded' do
+ url = 'http://user:pass%21%3F%40@github.com/t.git'
+ project = build(:project, import_url: url)
+
+ # When the credentials are not decoded this expectation fails
+ expect(project.import_url).to eq(url)
+ expect(project.import_data.credentials).to eq(user: 'user', password: 'pass!?@')
+ end
+
+ it 'saves url with no credentials' do
+ url = 'http://github.com/t.git'
+ project = build(:project, import_url: url)
+
+ expect(project.import_url).to eq(url)
+ expect(project.import_data.credentials).to eq(user: nil, password: nil)
+ end
end
describe '#container_registry_url' do
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index 0adf3fc8e85..00ffc3cae54 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -325,6 +325,14 @@ describe Repository do
expect(repository.commits(nil, all: true, limit: 60).size).to eq(60)
end
end
+
+ context "when 'order' flag is set" do
+ it 'passes order option to perform the query' do
+ expect(Gitlab::Git::Commit).to receive(:where).with(a_hash_including(order: 'topo')).and_call_original
+
+ repository.commits('master', limit: 1, order: 'topo')
+ end
+ end
end
describe '#new_commits' do