Skip to content

Commit

Permalink
Added omniauth integration spec for hashie#391.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Jan 31, 2017
1 parent 3ec07c8 commit 552cc8a
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Expand Up @@ -20,6 +20,10 @@ matrix:
- bundle exec danger
after_script:
- bundle exec codeclimate-test-reporter
include:
- rvm: 2.3.1
script:
- for dir in spec/integration/*; do echo $dir; pushd $dir; bundle install; bundle exec rspec; popd; done
allow_failures:
- rvm: ruby-head
- rvm: jruby-head
Expand Down
1 change: 1 addition & 0 deletions Rakefile
Expand Up @@ -7,6 +7,7 @@ Bundler::GemHelper.install_tasks
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new do |spec|
spec.pattern = 'spec/**/*_spec.rb'
spec.exclude_pattern = 'spec/integration/**/*_spec.rb'
end

require 'rubocop/rake_task'
Expand Down
3 changes: 3 additions & 0 deletions spec/integration/omniauth/.rspec
@@ -0,0 +1,3 @@
--colour
--format=documentation
--pattern=*_spec.rb
7 changes: 7 additions & 0 deletions spec/integration/omniauth/Gemfile
@@ -0,0 +1,7 @@
source 'http://rubygems.org'

gem 'hashie', path: '../../..'
gem 'omniauth', '~> 1.3.2'
gem 'sinatra'
gem 'rspec', '~> 3.5.0'
gem 'rack-test', '~> 0.6.3'
37 changes: 37 additions & 0 deletions spec/integration/omniauth/integration_spec.rb
@@ -0,0 +1,37 @@
ENV['RACK_ENV'] = 'test'

require 'rspec/core'
require 'rack/test'
require 'sinatra'
require 'omniauth'

class MyApplication < Sinatra::Base
use Rack::Session::Cookie
use OmniAuth::Strategies::Developer

get '/' do
'Hello World'
end
end

module RSpecMixin
include Rack::Test::Methods
def app
MyApplication
end
end

RSpec.configure do |config|
config.include RSpecMixin
config.expect_with :rspec do |expect|
expect.syntax = :expect
end
end

describe 'omniauth' do
it 'works' do
get '/'
expect(last_response).to be_ok
expect(last_response.body).to eq 'Hello World'
end
end

0 comments on commit 552cc8a

Please sign in to comment.