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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe02be96efe71757da10ec341058f0afb4ad3664
4
- data.tar.gz: dc81ab09d9be574d47163bdc6e1e8aa7fd0e393b
3
+ metadata.gz: 35cfedc9e1889b2aab2989b9341c56397ac720e8
4
+ data.tar.gz: be60c9da7cf9e5b3100eff50ca07584ccc066172
5
5
  SHA512:
6
- metadata.gz: a109ee2f66dbac1f35b3babe57ab97883abd71b4792b2ef808c959da0d618b4a009340f890c46252cc600c1a593569f3b232d755b382b56081feb6e4f4c1b359
7
- data.tar.gz: 644d95abe6a9f748e0aa2cb7ecc9187a464d0b341c4a57f261301e13129725099921bb4434d47d2bb9a9e95e22ad70d0b248b5518feabd26d7de30ae081812e8
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
- respond_with @subscriber, location: main_app.root_path
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
@@ -1,3 +1,3 @@
1
1
  module Waitlist
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -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
@@ -0,0 +1,9 @@
1
+ # This migration comes from waitlist (originally 20140919201517)
2
+ class CreateWaitlistSubscribers < ActiveRecord::Migration
3
+ def change
4
+ create_table :waitlist_subscribers do |t|
5
+ t.string :email
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
Binary file
@@ -242,3 +242,54 @@ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
242
242
  Prelaunch::Subscriber Exists (0.1ms) SELECT 1 AS one FROM "prelaunch_subscribers" WHERE "prelaunch_subscribers"."email" = 'this isn''t an email address' LIMIT 1
243
243
  Prelaunch::Subscriber Exists (0.0ms) SELECT 1 AS one FROM "prelaunch_subscribers" WHERE "prelaunch_subscribers"."email" = 'this isn''t an email address' LIMIT 1
244
244
   (0.0ms) rollback transaction
245
+  (0.9ms) CREATE TABLE "waitlist_subscribers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "created_at" datetime, "updated_at" datetime) 
246
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
247
+  (0.1ms) select sqlite_version(*)
248
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
249
+  (0.1ms) SELECT version FROM "schema_migrations"
250
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140919201517')
251
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
252
+  (0.1ms) begin transaction
253
+  (0.1ms) rollback transaction
254
+  (0.0ms) begin transaction
255
+  (0.1ms) rollback transaction
256
+  (0.1ms) begin transaction
257
+  (0.1ms) rollback transaction
258
+  (0.0ms) begin transaction
259
+  (0.0ms) rollback transaction
260
+  (0.1ms) begin transaction
261
+  (0.0ms) rollback transaction
262
+  (0.0ms) begin transaction
263
+  (0.0ms) rollback transaction
264
+  (0.0ms) begin transaction
265
+  (0.1ms) rollback transaction
266
+  (0.0ms) begin transaction
267
+  (0.0ms) rollback transaction
268
+  (0.1ms) 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
+  (0.0ms) rollback transaction
273
+  (0.0ms) 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
+  (0.0ms) rollback transaction
278
+  (0.0ms) 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
+  (0.0ms) rollback transaction
283
+  (0.0ms) 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
+  (0.0ms) rollback transaction
288
+  (0.0ms) begin transaction
289
+ Processing by Waitlist::SubscribersController#new as HTML
290
+ Completed 500 Internal Server Error in 0ms
291
+  (0.0ms) rollback transaction
292
+  (0.0ms) begin transaction
293
+ Processing by Waitlist::SubscribersController#new as HTML
294
+ Completed 500 Internal Server Error in 0ms
295
+  (0.0ms) rollback transaction
@@ -1,3 +1,3 @@
1
1
  TestApp::Application.routes.draw do
2
- mount Prelaunch::Engine => "/prelaunch"
2
+ mount Waitlist::Engine => "/waitlist", as: "waitlist"
3
3
  end
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.1
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-09-29 00:00:00.000000000 Z
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