Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #8 from cobot/heroku-pipeline
Browse files Browse the repository at this point in the history
testing heroku preview apps and pipeline
  • Loading branch information
thilo authored Mar 15, 2020
2 parents 5ee524e + 605b396 commit d47dfff
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 28 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
Expand Down
24 changes: 14 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -73,7 +75,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)
Expand Down Expand Up @@ -117,12 +119,12 @@ 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)
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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -187,7 +191,7 @@ DEPENDENCIES
nokogiri (>= 1.10.4)
oauth2
padrino (= 0.12.9)
pg
pg (= 0.21)
poltergeist
puffing-billy
rack (>= 1.6.11)
Expand All @@ -200,7 +204,7 @@ DEPENDENCIES
webmock

RUBY VERSION
ruby 2.4.7p357
ruby 2.4.9p362

BUNDLED WITH
1.17.3
15 changes: 15 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"environments": {
"review": {
"formation": {
"web": {
"quantity": 1,
"size": "hobby"
}
},
"addons": [
"heroku-postgresql:hobby-dev"
]
}
}
}
30 changes: 14 additions & 16 deletions spec/integration/app_spec.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit d47dfff

Please sign in to comment.