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
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-03-24 16:53:30 +0300
committerDouwe Maan <douwe@gitlab.com>2015-03-27 13:09:29 +0300
commit3f7531d6f2974ea75ab8e67bc93049f674ddb672 (patch)
tree5340386a05e4970e7064392741c18f053157fccc /spec
parent28592ae46767443dc0f3723bd4f05f360bab8f41 (diff)
Move User.cleanup_username to Namespace.cleanup_path.
Diffstat (limited to 'spec')
-rw-r--r--spec/models/namespace_spec.rb10
-rw-r--r--spec/models/user_spec.rb10
2 files changed, 10 insertions, 10 deletions
diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb
index ed6845c82cc..48a3ab9c5a2 100644
--- a/spec/models/namespace_spec.rb
+++ b/spec/models/namespace_spec.rb
@@ -85,4 +85,14 @@ describe Namespace do
it { expect(Namespace.find_by_path_or_name('WOW')).to eq(@namespace) }
it { expect(Namespace.find_by_path_or_name('unknown')).to eq(nil) }
end
+
+ describe ".clean_path" do
+
+ let!(:user) { create(:user, username: "johngitlab-etc") }
+ let!(:namespace) { create(:namespace, path: "JohnGitLab-etc1") }
+
+ it "cleans the path and makes sure it's available" do
+ expect(Namespace.clean_path("-john+gitlab-ETC%.git@gmail.com")).to eq("johngitlab-ETC2")
+ end
+ end
end
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 10e90cae143..24384e8bf22 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -307,16 +307,6 @@ describe User do
end
end
- describe ".clean_username" do
-
- let!(:user) { create(:user, username: "johngitlab-etc") }
- let!(:namespace) { create(:namespace, path: "JohnGitLab-etc1") }
-
- it "cleans a username and makes sure it's available" do
- expect(User.clean_username("-john+gitlab-ETC%.git@gmail.com")).to eq("johngitlab-ETC2")
- end
- end
-
describe 'all_ssh_keys' do
it { is_expected.to have_many(:keys).dependent(:destroy) }