proposal 0.0.2 → 0.0.3
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/app/models/proposal/token.rb +17 -13
- data/db/migrate/20121026005348_create_proposal_tokens.rb +3 -1
- data/lib/proposal/version.rb +1 -1
- data/test/dummy/db/proposal.sqlite3 +0 -0
- data/test/dummy/log/test.log +5056 -0
- data/test/proposal_test.rb +15 -0
- metadata +4 -4
data/test/proposal_test.rb
CHANGED
@@ -239,7 +239,22 @@ class ProposalTest < ActiveSupport::TestCase
|
|
239
239
|
existing.accept!
|
240
240
|
|
241
241
|
proposal = User.propose(project).to email
|
242
|
+
proposal.save!
|
242
243
|
assert_equal false, existing.acceptable?
|
243
244
|
assert_equal true, proposal.acceptable?
|
244
245
|
end
|
246
|
+
|
247
|
+
test "should not create a new token if token exists" do
|
248
|
+
token_one = Proposal::Token.new email: email,
|
249
|
+
proposable_type: User.to_s
|
250
|
+
|
251
|
+
token_two = Proposal::Token.new email: email,
|
252
|
+
proposable_type: User.to_s
|
253
|
+
|
254
|
+
errors = { email: ["already has an outstanding proposal"] }
|
255
|
+
|
256
|
+
assert_equal true, token_one.save
|
257
|
+
assert_equal false, token_two.save
|
258
|
+
assert_equal errors, token_two.errors.messages
|
259
|
+
end
|
245
260
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proposal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -116,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: '0'
|
117
117
|
segments:
|
118
118
|
- 0
|
119
|
-
hash:
|
119
|
+
hash: 2943663682525270322
|
120
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
121
|
none: false
|
122
122
|
requirements:
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
segments:
|
127
127
|
- 0
|
128
|
-
hash:
|
128
|
+
hash: 2943663682525270322
|
129
129
|
requirements: []
|
130
130
|
rubyforge_project:
|
131
131
|
rubygems_version: 1.8.24
|