saucy 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +4 -0
- data/app/models/signup.rb +2 -2
- data/lib/saucy/account.rb +1 -1
- data/lib/saucy/project.rb +1 -1
- data/spec/models/account_spec.rb +1 -0
- data/spec/models/project_spec.rb +1 -0
- data/spec/models/signup_spec.rb +16 -0
- metadata +3 -3
data/CHANGELOG.md
CHANGED
data/app/models/signup.rb
CHANGED
|
@@ -98,9 +98,9 @@ class Signup
|
|
|
98
98
|
|
|
99
99
|
def short_name
|
|
100
100
|
if email.present?
|
|
101
|
-
email.split(/@/).first
|
|
101
|
+
email.split(/@/).first.parameterize
|
|
102
102
|
elsif user && user.email.present?
|
|
103
|
-
existing_user.email.split(/@/).first
|
|
103
|
+
existing_user.email.split(/@/).first.parameterize
|
|
104
104
|
end
|
|
105
105
|
end
|
|
106
106
|
|
data/lib/saucy/account.rb
CHANGED
data/lib/saucy/project.rb
CHANGED
data/spec/models/account_spec.rb
CHANGED
|
@@ -16,6 +16,7 @@ describe Account do
|
|
|
16
16
|
it { should allow_value("hello").for(:keyword) }
|
|
17
17
|
it { should allow_value("0123").for(:keyword) }
|
|
18
18
|
it { should allow_value("hello_world").for(:keyword) }
|
|
19
|
+
it { should allow_value("hello-world").for(:keyword) }
|
|
19
20
|
it { should_not allow_value("HELLO").for(:keyword) }
|
|
20
21
|
it { should_not allow_value("hello world").for(:keyword) }
|
|
21
22
|
|
data/spec/models/project_spec.rb
CHANGED
|
@@ -10,6 +10,7 @@ describe Project do
|
|
|
10
10
|
it { should allow_value("hello").for(:keyword) }
|
|
11
11
|
it { should allow_value("0123").for(:keyword) }
|
|
12
12
|
it { should allow_value("hello_world").for(:keyword) }
|
|
13
|
+
it { should allow_value("hello-world").for(:keyword) }
|
|
13
14
|
it { should_not allow_value("HELLO").for(:keyword) }
|
|
14
15
|
it { should_not allow_value("hello world").for(:keyword) }
|
|
15
16
|
|
data/spec/models/signup_spec.rb
CHANGED
|
@@ -91,6 +91,22 @@ describe Signup, "with a valid user and account" do
|
|
|
91
91
|
end
|
|
92
92
|
end
|
|
93
93
|
|
|
94
|
+
describe Signup, "with an email with symbols in it" do
|
|
95
|
+
subject { Factory.build(:signup, :email => "user+extra@example.com") }
|
|
96
|
+
|
|
97
|
+
before do
|
|
98
|
+
subject.save
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
it "gives a friendly account name" do
|
|
102
|
+
subject.account.name.should == "user-extra"
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
it "gives a friendly account keyword" do
|
|
106
|
+
subject.account.keyword.should =~ /^user-extra+/
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
94
110
|
describe Signup, "with an invalid user" do
|
|
95
111
|
subject { Factory.build(:signup, :email => nil) }
|
|
96
112
|
it_should_behave_like "invalid signup"
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: saucy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 1
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 5
|
|
9
|
-
-
|
|
10
|
-
version: 0.5.
|
|
9
|
+
- 5
|
|
10
|
+
version: 0.5.5
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- thoughtbot, inc.
|