From 670f64841853a89a33d7dad267df749ad35ce377 Mon Sep 17 00:00:00 2001 From: Thilo Utke Date: Sun, 15 Mar 2020 21:28:23 +0100 Subject: [PATCH 1/6] testing heroku preview apps --- Gemfile.lock | 2 +- app.json | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 app.json diff --git a/Gemfile.lock b/Gemfile.lock index b4c380d..c02de68 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -73,7 +73,7 @@ GEM multi_json (1.12.1) multi_xml (0.5.3) multipart-post (2.0.0) - nokogiri (1.10.4) + nokogiri (1.10.9) mini_portile2 (~> 2.4.0) oauth2 (0.9.1) faraday (~> 0.8) diff --git a/app.json b/app.json new file mode 100644 index 0000000..47f66d0 --- /dev/null +++ b/app.json @@ -0,0 +1,9 @@ +{ + "environments": { + "review": { + "addons": [ + "heroku-postgresql:hobby-dev" + ] + } + } +} \ No newline at end of file From 10f83363afa1f9098dd67bc34492dbd09d69aca6 Mon Sep 17 00:00:00 2001 From: Thilo Utke Date: Sun, 15 Mar 2020 21:51:17 +0100 Subject: [PATCH 2/6] updated webmock --- Gemfile.lock | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c02de68..84c6b5c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,8 +13,8 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) arel (6.0.4) builder (3.2.3) capybara (2.17.0) @@ -26,7 +26,8 @@ GEM xpath (>= 2.0, < 4.0) cliver (0.3.2) cookiejar (0.3.0) - crack (0.3.2) + crack (0.4.3) + safe_yaml (~> 1.0.0) database_cleaner (1.0.1) diff-lcs (1.2.4) dotenv (0.7.0) @@ -48,6 +49,7 @@ GEM foreman (0.63.0) dotenv (>= 0.7) thor (>= 0.13.6) + hashdiff (1.0.1) http_parser.rb (0.6.0) http_router (0.11.2) rack (>= 1.0.0) @@ -122,7 +124,7 @@ GEM capybara (~> 2.1) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) - public_suffix (3.0.1) + public_suffix (4.0.3) puffing-billy (0.9.1) addressable em-http-request (~> 1.1.0) @@ -146,6 +148,7 @@ GEM rspec-expectations (2.13.0) diff-lcs (>= 1.1.3, < 2.0) rspec-mocks (2.13.1) + safe_yaml (1.0.5) sentry-raven (2.11.2) faraday (>= 0.7.6, < 1.0) sinatra (1.4.8) @@ -163,9 +166,10 @@ GEM raindrops (~> 0.7) url_mount (0.2.1) rack - webmock (1.11.0) - addressable (>= 2.2.7) + webmock (3.8.3) + addressable (>= 2.3.6) crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) From 114f1fd336dd87f7df380bc86d5232465e671ef7 Mon Sep 17 00:00:00 2001 From: Thilo Utke Date: Sun, 15 Mar 2020 21:51:34 +0100 Subject: [PATCH 3/6] updated spec --- spec/integration/app_spec.rb | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/spec/integration/app_spec.rb b/spec/integration/app_spec.rb index d52299a..8cc8d51 100644 --- a/spec/integration/app_spec.rb +++ b/spec/integration/app_spec.rb @@ -1,35 +1,33 @@ +# frozen_string_literal: true + require 'spec_helper' -describe "user opens app the first time", type: :request do +describe 'user opens app the first time', type: :request do before(:each) do @fb_auth = stub_fb_auth - @fb_request_params = {'page' => {'id' => '123'}} + @fb_request_params = { 'page' => { 'id' => '123' } } @fb_auth.stub(parse_signed_request: @fb_request_params) end - describe "from the app start page", type: :feature do - it "displays the auth link for the page admin and redirects to auth" do + describe 'from the app start page', type: :feature do + it 'displays app is discontinues' do visit '/' - - click_link 'Get Started' - - URI.parse(current_url).to_s.should =~ %r{https://www.cobot.me/oauth/authorize} + expect(page).to have_content('We are sorry!') end end - describe "after it is setup on facebook", type: :feature, js: true do + describe 'after it is setup on facebook', type: :feature, js: true do before(:each) do - Space.create! space_id: 'test', fb_id: "123", token: 't0k3n' + Space.create! space_id: 'test', fb_id: '123', token: 't0k3n' WebMock.allow_net_connect! end - it "shows the plans" do + it 'shows the plans' do stub_space_response('test') - @plan_hash = {name: "My Plan", price_per_cycle: "100.0", cycle_duration: 1, - currency: "EUR", description: "basic plan", - day_pass_price: "10.0", cancellation_period: 30, hidden: false, - time_passes: [] - } + @plan_hash = { name: 'My Plan', price_per_cycle: '100.0', cycle_duration: 1, + currency: 'EUR', description: 'basic plan', + day_pass_price: '10.0', cancellation_period: 30, hidden: false, + time_passes: [] } stub_plans_response_for_space('test', [@plan_hash]) fake_fb_post From 4c082495251facfe7eb2dedfaf3910db30d53d59 Mon Sep 17 00:00:00 2001 From: Thilo Utke Date: Sun, 15 Mar 2020 22:00:02 +0100 Subject: [PATCH 4/6] updated app.json --- app.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app.json b/app.json index 47f66d0..dcc0e04 100644 --- a/app.json +++ b/app.json @@ -1,4 +1,11 @@ { + "name": "Cobot Facebook Plans", + "env": { + "RACK_ENV": "production" + }, + "addons": [ + "heroku-postgresql:hobby-dev" + ], "environments": { "review": { "addons": [ From f50894393abfd74733d9c82af35ec7bd70639f24 Mon Sep 17 00:00:00 2001 From: Thilo Utke Date: Sun, 15 Mar 2020 22:22:53 +0100 Subject: [PATCH 5/6] smaller dyno for preview --- app.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app.json b/app.json index dcc0e04..6e8398b 100644 --- a/app.json +++ b/app.json @@ -8,6 +8,12 @@ ], "environments": { "review": { + "formation": { + "web": { + "quantity": 1, + "size": "free" + } + }, "addons": [ "heroku-postgresql:hobby-dev" ] From 605b396dcfa1a4a0ef6d04132a1ca678cdd6f422 Mon Sep 17 00:00:00 2001 From: Thilo Utke Date: Sun, 15 Mar 2020 22:53:45 +0100 Subject: [PATCH 6/6] ruby version update and pg gem --- Gemfile | 4 ++-- Gemfile.lock | 6 +++--- app.json | 9 +-------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Gemfile b/Gemfile index 2226a23..5582ea9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ # frozen_string_literal: true source 'https://rubygems.org' -ruby '2.4.7' +ruby '2.4.9' # Server requirements (defaults to WEBrick) gem 'unicorn' @@ -18,7 +18,7 @@ gem 'sentry-raven' # Component requirements gem 'activerecord', '~> 4.0', require: 'active_record' gem 'erubis' -gem 'pg' +gem 'pg', "0.21" # Test requirements group 'test' do diff --git a/Gemfile.lock b/Gemfile.lock index 84c6b5c..942e2d5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -119,7 +119,7 @@ GEM padrino-core (= 0.12.9) padrino-support (0.12.9) activesupport (>= 3.1) - pg (0.15.1) + pg (0.21.0) poltergeist (1.14.0) capybara (~> 2.1) cliver (~> 0.3.1) @@ -191,7 +191,7 @@ DEPENDENCIES nokogiri (>= 1.10.4) oauth2 padrino (= 0.12.9) - pg + pg (= 0.21) poltergeist puffing-billy rack (>= 1.6.11) @@ -204,7 +204,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 2.4.7p357 + ruby 2.4.9p362 BUNDLED WITH 1.17.3 diff --git a/app.json b/app.json index 6e8398b..c04a824 100644 --- a/app.json +++ b/app.json @@ -1,17 +1,10 @@ { - "name": "Cobot Facebook Plans", - "env": { - "RACK_ENV": "production" - }, - "addons": [ - "heroku-postgresql:hobby-dev" - ], "environments": { "review": { "formation": { "web": { "quantity": 1, - "size": "free" + "size": "hobby" } }, "addons": [