proposal 1.0.0 → 2.0.0
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.
- checksums.yaml +5 -5
- data/Rakefile +11 -16
- data/app/models/proposal/token.rb +5 -5
- data/app/validators/proposal/proposable_validator.rb +11 -0
- data/lib/proposal/engine.rb +1 -1
- data/lib/proposal/version.rb +1 -1
- data/test/dummy/Rakefile +1 -1
- data/test/dummy/config/boot.rb +1 -1
- data/test/dummy/config/environments/production.rb +1 -1
- data/test/dummy/config/environments/test.rb +2 -2
- data/test/dummy/db/proposal.sqlite3 +0 -0
- data/test/dummy/log/development.log +59 -3
- data/test/dummy/log/test.log +10545 -54848
- data/test/proposal_test.rb +10 -9
- data/test/test_helper.rb +11 -7
- metadata +36 -49
data/test/proposal_test.rb
CHANGED
@@ -48,8 +48,8 @@ class ProposalTest < ActiveSupport::TestCase
|
|
48
48
|
end
|
49
49
|
|
50
50
|
test "should respond to the resource" do
|
51
|
+
User.create email: email
|
51
52
|
project = Project.create!
|
52
|
-
user = User.create email: email
|
53
53
|
proposal = User.propose(project).to email
|
54
54
|
assert_equal project, proposal.resource
|
55
55
|
end
|
@@ -58,6 +58,7 @@ class ProposalTest < ActiveSupport::TestCase
|
|
58
58
|
proposal = User.propose.to email
|
59
59
|
proposal.save
|
60
60
|
|
61
|
+
assert_equal true, proposal.persisted?
|
61
62
|
assert_equal proposal.token.class, String
|
62
63
|
end
|
63
64
|
|
@@ -163,7 +164,7 @@ class ProposalTest < ActiveSupport::TestCase
|
|
163
164
|
end
|
164
165
|
|
165
166
|
test "should not return proposal action notify" do
|
166
|
-
|
167
|
+
User.create email: email
|
167
168
|
proposal = User.propose.to email
|
168
169
|
assert_equal :notify, proposal.action
|
169
170
|
assert_equal true, proposal.notify?
|
@@ -188,7 +189,7 @@ class ProposalTest < ActiveSupport::TestCase
|
|
188
189
|
end
|
189
190
|
|
190
191
|
test "should have action remind for notify (existing user)" do
|
191
|
-
|
192
|
+
User.create email: email
|
192
193
|
existing = User.propose.to email
|
193
194
|
existing.save!
|
194
195
|
|
@@ -214,7 +215,7 @@ class ProposalTest < ActiveSupport::TestCase
|
|
214
215
|
end
|
215
216
|
|
216
217
|
test "should set reminded safe" do
|
217
|
-
|
218
|
+
User.create email: email
|
218
219
|
existing = User.propose.to email
|
219
220
|
existing.save!
|
220
221
|
|
@@ -224,7 +225,7 @@ class ProposalTest < ActiveSupport::TestCase
|
|
224
225
|
end
|
225
226
|
|
226
227
|
test "should set reminded bang" do
|
227
|
-
|
228
|
+
User.create email: email
|
228
229
|
existing = User.propose.to email
|
229
230
|
existing.save!
|
230
231
|
|
@@ -235,7 +236,7 @@ class ProposalTest < ActiveSupport::TestCase
|
|
235
236
|
|
236
237
|
test "should find and accept proposal" do
|
237
238
|
email = "user@example.com"
|
238
|
-
|
239
|
+
User.create email: email
|
239
240
|
proposal = User.propose.to email
|
240
241
|
proposal.save
|
241
242
|
|
@@ -256,7 +257,7 @@ class ProposalTest < ActiveSupport::TestCase
|
|
256
257
|
|
257
258
|
test "should create a new token if accepted token exists" do
|
258
259
|
project = Project.create!
|
259
|
-
|
260
|
+
User.create email: email
|
260
261
|
existing = User.propose(project).to email
|
261
262
|
existing.save!
|
262
263
|
existing.accept!
|
@@ -282,12 +283,12 @@ class ProposalTest < ActiveSupport::TestCase
|
|
282
283
|
end
|
283
284
|
|
284
285
|
test "should return proposals for resource instance" do
|
285
|
-
|
286
|
+
User.create email: email
|
286
287
|
project = Project.create!
|
287
288
|
proposal = User.propose(project).to(email)
|
288
289
|
proposal.save
|
289
290
|
|
290
|
-
assert_equal [proposal], project.proposals
|
291
|
+
assert_equal [proposal], project.proposals
|
291
292
|
end
|
292
293
|
|
293
294
|
test "should return proposals for proposer instance" do
|
data/test/test_helper.rb
CHANGED
@@ -1,18 +1,22 @@
|
|
1
1
|
# Configure Rails Environment
|
2
2
|
ENV["RAILS_ENV"] = "test"
|
3
3
|
|
4
|
-
require File.expand_path("
|
4
|
+
require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
|
5
|
+
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
|
6
|
+
ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__)
|
5
7
|
require "rails/test_help"
|
6
8
|
|
9
|
+
# Filter out Minitest backtrace while allowing backtrace from other libraries
|
10
|
+
# to be shown.
|
11
|
+
Minitest.backtrace_filter = Minitest::BacktraceFilter.new
|
12
|
+
|
7
13
|
Rails.backtrace_cleaner.remove_silencers!
|
8
14
|
|
9
|
-
# Load support files
|
10
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
11
15
|
|
12
16
|
# Load fixtures from the engine
|
13
|
-
if ActiveSupport::TestCase.
|
17
|
+
if ActiveSupport::TestCase.respond_to?(:fixture_path=)
|
14
18
|
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
19
|
+
ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
|
20
|
+
ActiveSupport::TestCase.file_fixture_path = ActiveSupport::TestCase.fixture_path + "/files"
|
21
|
+
ActiveSupport::TestCase.fixtures :all
|
15
22
|
end
|
16
|
-
|
17
|
-
ActiveRecord::Migrator.up("db/migrate")
|
18
|
-
ActiveRecord::Migrator.up(File.expand_path("../dummy/db/migrate", __FILE__))
|
metadata
CHANGED
@@ -1,71 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proposal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rufus Post
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 5.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 5.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sqlite3
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rubocop
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - '>='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 0.9.6
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: minitest
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 4.2.0
|
47
|
+
version: '0'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- -
|
52
|
+
- - ">="
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
54
|
+
version: '0'
|
69
55
|
description:
|
70
56
|
email:
|
71
57
|
- rufuspost@gmail.com
|
@@ -73,17 +59,20 @@ executables: []
|
|
73
59
|
extensions: []
|
74
60
|
extra_rdoc_files: []
|
75
61
|
files:
|
62
|
+
- Rakefile
|
76
63
|
- app/models/proposal/token.rb
|
77
64
|
- app/validators/proposal/arguments_validator.rb
|
78
65
|
- app/validators/proposal/email_validator.rb
|
66
|
+
- app/validators/proposal/proposable_validator.rb
|
79
67
|
- db/migrate/20121026005348_create_proposal_tokens.rb
|
68
|
+
- lib/proposal.rb
|
80
69
|
- lib/proposal/engine.rb
|
81
70
|
- lib/proposal/version.rb
|
82
|
-
- lib/proposal.rb
|
83
71
|
- lib/tasks/proposal_tasks.rake
|
84
|
-
- Rakefile
|
72
|
+
- test/dummy/Rakefile
|
85
73
|
- test/dummy/app/models/project.rb
|
86
74
|
- test/dummy/app/models/user.rb
|
75
|
+
- test/dummy/config.ru
|
87
76
|
- test/dummy/config/application.rb
|
88
77
|
- test/dummy/config/boot.rb
|
89
78
|
- test/dummy/config/database.yml
|
@@ -99,18 +88,17 @@ files:
|
|
99
88
|
- test/dummy/config/initializers/wrap_parameters.rb
|
100
89
|
- test/dummy/config/locales/en.yml
|
101
90
|
- test/dummy/config/routes.rb
|
102
|
-
- test/dummy/config.ru
|
103
91
|
- test/dummy/db/migrate/20121026035505_create_users.rb
|
104
92
|
- test/dummy/db/migrate/20121031041439_create_projects.rb
|
105
93
|
- test/dummy/db/proposal.sqlite3
|
106
94
|
- test/dummy/log/development.log
|
107
95
|
- test/dummy/log/test.log
|
108
|
-
- test/dummy/Rakefile
|
109
96
|
- test/dummy/script/rails
|
110
97
|
- test/proposal_test.rb
|
111
98
|
- test/test_helper.rb
|
112
99
|
homepage: https://github.com/mynameisrufus/proposal
|
113
|
-
licenses:
|
100
|
+
licenses:
|
101
|
+
- MIT
|
114
102
|
metadata: {}
|
115
103
|
post_install_message:
|
116
104
|
rdoc_options: []
|
@@ -118,45 +106,44 @@ require_paths:
|
|
118
106
|
- lib
|
119
107
|
required_ruby_version: !ruby/object:Gem::Requirement
|
120
108
|
requirements:
|
121
|
-
- -
|
109
|
+
- - ">="
|
122
110
|
- !ruby/object:Gem::Version
|
123
111
|
version: '0'
|
124
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
113
|
requirements:
|
126
|
-
- -
|
114
|
+
- - ">="
|
127
115
|
- !ruby/object:Gem::Version
|
128
116
|
version: '0'
|
129
117
|
requirements: []
|
130
|
-
|
131
|
-
rubygems_version: 2.0.0
|
118
|
+
rubygems_version: 3.0.3
|
132
119
|
signing_key:
|
133
120
|
specification_version: 4
|
134
121
|
summary: Simple unobtrusive token invitation engine for rails
|
135
122
|
test_files:
|
136
123
|
- test/dummy/app/models/project.rb
|
137
124
|
- test/dummy/app/models/user.rb
|
138
|
-
- test/dummy/config/
|
139
|
-
- test/dummy/config/
|
140
|
-
- test/dummy/config/database.yml
|
141
|
-
- test/dummy/config/environment.rb
|
142
|
-
- test/dummy/config/environments/development.rb
|
125
|
+
- test/dummy/config/routes.rb
|
126
|
+
- test/dummy/config/locales/en.yml
|
143
127
|
- test/dummy/config/environments/production.rb
|
128
|
+
- test/dummy/config/environments/development.rb
|
144
129
|
- test/dummy/config/environments/test.rb
|
130
|
+
- test/dummy/config/environment.rb
|
131
|
+
- test/dummy/config/application.rb
|
132
|
+
- test/dummy/config/database.yml
|
133
|
+
- test/dummy/config/boot.rb
|
145
134
|
- test/dummy/config/initializers/backtrace_silencers.rb
|
146
|
-
- test/dummy/config/initializers/inflections.rb
|
147
135
|
- test/dummy/config/initializers/mime_types.rb
|
148
|
-
- test/dummy/config/initializers/secret_token.rb
|
149
136
|
- test/dummy/config/initializers/session_store.rb
|
150
137
|
- test/dummy/config/initializers/wrap_parameters.rb
|
151
|
-
- test/dummy/config/
|
152
|
-
- test/dummy/config/
|
138
|
+
- test/dummy/config/initializers/secret_token.rb
|
139
|
+
- test/dummy/config/initializers/inflections.rb
|
153
140
|
- test/dummy/config.ru
|
141
|
+
- test/dummy/script/rails
|
142
|
+
- test/dummy/Rakefile
|
143
|
+
- test/dummy/db/proposal.sqlite3
|
154
144
|
- test/dummy/db/migrate/20121026035505_create_users.rb
|
155
145
|
- test/dummy/db/migrate/20121031041439_create_projects.rb
|
156
|
-
- test/dummy/db/proposal.sqlite3
|
157
|
-
- test/dummy/log/development.log
|
158
146
|
- test/dummy/log/test.log
|
159
|
-
- test/dummy/
|
160
|
-
- test/dummy/script/rails
|
147
|
+
- test/dummy/log/development.log
|
161
148
|
- test/proposal_test.rb
|
162
149
|
- test/test_helper.rb
|