Added omniauth integration spec for #391.
This commit is contained in:
parent
3ec07c8728
commit
9cc952f607
|
@ -20,6 +20,11 @@ matrix:
|
|||
- bundle exec danger
|
||||
after_script:
|
||||
- bundle exec codeclimate-test-reporter
|
||||
- rvm: 2.3.1
|
||||
install:
|
||||
- for dir in spec/integration/*; do BUNDLE_GEMFILE=$dir/Gemfile bundle; done
|
||||
script:
|
||||
- for dir in spec/integration/*; do BUNDLE_GEMFILE=$dir/Gemfile bundle exec rspec $dir; done
|
||||
allow_failures:
|
||||
- rvm: ruby-head
|
||||
- rvm: jruby-head
|
||||
|
|
1
Rakefile
1
Rakefile
|
@ -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'
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
--colour
|
||||
--format=documentation
|
||||
--pattern=*_spec.rb
|
|
@ -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'
|
|
@ -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
|
Loading…
Reference in New Issue