waitlist 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/waitlist/subscribers_controller.rb +2 -1
- data/lib/waitlist/version.rb +1 -1
- data/spec/controllers/waitlist_subscribers_spec.rb +7 -1
- data/spec/dummy/db/migrate/20141007155317_create_waitlist_subscribers.waitlist.rb +9 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +51 -0
- data/spec/dummy/tmp/generated_files/config/routes.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35cfedc9e1889b2aab2989b9341c56397ac720e8
|
4
|
+
data.tar.gz: be60c9da7cf9e5b3100eff50ca07584ccc066172
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98ee639f050ac83071d0b322bc837c59fb7255611ee26b6659eaea29de8c9bfbe9d56f24ea8778155011ba206917b1820bf895dd388eb74bdf623067609d9f63
|
7
|
+
data.tar.gz: 762ead494757ab9276188df6e7c214c18d387af89050708d72fbb29b68e883c2384aaca07564b2b7b145fd79e578455f211519f939bd685cc1507342a32155cc
|
@@ -10,7 +10,8 @@ module Waitlist
|
|
10
10
|
def create
|
11
11
|
@subscriber = Subscriber.new(subscriber_params)
|
12
12
|
flash[:notice] = 'Thanks for signing up!' if @subscriber.save
|
13
|
-
|
13
|
+
return_to = params[:return_to] || main_app.root_path
|
14
|
+
respond_with @subscriber, location: return_to
|
14
15
|
end
|
15
16
|
|
16
17
|
def subscriber_params
|
data/lib/waitlist/version.rb
CHANGED
@@ -13,7 +13,6 @@ RSpec.describe Waitlist::SubscribersController do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
describe '#create' do
|
16
|
-
|
17
16
|
context 'with valid address' do
|
18
17
|
before do
|
19
18
|
post :create, subscriber: { email: 'valid.address@thegarage.us' }
|
@@ -21,6 +20,13 @@ RSpec.describe Waitlist::SubscribersController do
|
|
21
20
|
|
22
21
|
it { should redirect_to '/' }
|
23
22
|
end
|
23
|
+
context 'with valid request and params[:return_to]' do
|
24
|
+
let(:redirect_url) { 'http://google.com' }
|
25
|
+
before do
|
26
|
+
post :create, subscriber: { email: 'valid.address@thegarage.us' }, return_to: redirect_url
|
27
|
+
end
|
28
|
+
it { should redirect_to redirect_url }
|
29
|
+
end
|
24
30
|
|
25
31
|
context 'as a json ajax request with invalid paramaters' do
|
26
32
|
before do
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -242,3 +242,54 @@ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
|
|
242
242
|
[1m[35mPrelaunch::Subscriber Exists (0.1ms)[0m SELECT 1 AS one FROM "prelaunch_subscribers" WHERE "prelaunch_subscribers"."email" = 'this isn''t an email address' LIMIT 1
|
243
243
|
[1m[36mPrelaunch::Subscriber Exists (0.0ms)[0m [1mSELECT 1 AS one FROM "prelaunch_subscribers" WHERE "prelaunch_subscribers"."email" = 'this isn''t an email address' LIMIT 1[0m
|
244
244
|
[1m[35m (0.0ms)[0m rollback transaction
|
245
|
+
[1m[36m (0.9ms)[0m [1mCREATE TABLE "waitlist_subscribers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
246
|
+
[1m[35m (0.9ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
247
|
+
[1m[36m (0.1ms)[0m [1mselect sqlite_version(*)[0m
|
248
|
+
[1m[35m (0.8ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
249
|
+
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
250
|
+
[1m[35m (0.8ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20140919201517')
|
251
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
252
|
+
[1m[35m (0.1ms)[0m begin transaction
|
253
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
254
|
+
[1m[35m (0.0ms)[0m begin transaction
|
255
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
256
|
+
[1m[35m (0.1ms)[0m begin transaction
|
257
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
258
|
+
[1m[35m (0.0ms)[0m begin transaction
|
259
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
260
|
+
[1m[35m (0.1ms)[0m begin transaction
|
261
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
262
|
+
[1m[35m (0.0ms)[0m begin transaction
|
263
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
264
|
+
[1m[35m (0.0ms)[0m begin transaction
|
265
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
266
|
+
[1m[35m (0.0ms)[0m begin transaction
|
267
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
268
|
+
[1m[35m (0.1ms)[0m begin transaction
|
269
|
+
Processing by Waitlist::SubscribersController#create as HTML
|
270
|
+
Parameters: {"subscriber"=>{"email"=>"valid.address@thegarage.us"}, "return_to"=>"http://google.com"}
|
271
|
+
Completed 500 Internal Server Error in 1ms
|
272
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
273
|
+
[1m[35m (0.0ms)[0m begin transaction
|
274
|
+
Processing by Waitlist::SubscribersController#create as HTML
|
275
|
+
Parameters: {"subscriber"=>{"email"=>"this isn't an email address"}}
|
276
|
+
Completed 500 Internal Server Error in 0ms
|
277
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
278
|
+
[1m[35m (0.0ms)[0m begin transaction
|
279
|
+
Processing by Waitlist::SubscribersController#create as JSON
|
280
|
+
Parameters: {"subscriber"=>{"email"=>"this isn't an email address"}}
|
281
|
+
Completed 500 Internal Server Error in 0ms
|
282
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
283
|
+
[1m[35m (0.0ms)[0m begin transaction
|
284
|
+
Processing by Waitlist::SubscribersController#create as HTML
|
285
|
+
Parameters: {"subscriber"=>{"email"=>"valid.address@thegarage.us"}}
|
286
|
+
Completed 500 Internal Server Error in 0ms
|
287
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
288
|
+
[1m[35m (0.0ms)[0m begin transaction
|
289
|
+
Processing by Waitlist::SubscribersController#new as HTML
|
290
|
+
Completed 500 Internal Server Error in 0ms
|
291
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
292
|
+
[1m[35m (0.0ms)[0m begin transaction
|
293
|
+
Processing by Waitlist::SubscribersController#new as HTML
|
294
|
+
Completed 500 Internal Server Error in 0ms
|
295
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: waitlist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Garage
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -151,6 +151,7 @@ files:
|
|
151
151
|
- spec/dummy/config/secrets.yml
|
152
152
|
- spec/dummy/db/development.sqlite3
|
153
153
|
- spec/dummy/db/migrate/20140925215627_create_prelaunch_subscribers.prelaunch.rb
|
154
|
+
- spec/dummy/db/migrate/20141007155317_create_waitlist_subscribers.waitlist.rb
|
154
155
|
- spec/dummy/db/schema.rb
|
155
156
|
- spec/dummy/db/test.sqlite3
|
156
157
|
- spec/dummy/log/development.log
|
@@ -221,6 +222,7 @@ test_files:
|
|
221
222
|
- spec/dummy/config.ru
|
222
223
|
- spec/dummy/db/development.sqlite3
|
223
224
|
- spec/dummy/db/migrate/20140925215627_create_prelaunch_subscribers.prelaunch.rb
|
225
|
+
- spec/dummy/db/migrate/20141007155317_create_waitlist_subscribers.waitlist.rb
|
224
226
|
- spec/dummy/db/schema.rb
|
225
227
|
- spec/dummy/db/test.sqlite3
|
226
228
|
- spec/dummy/log/development.log
|