Browse Source

Merge pull request #53 from alphagov/test-against-newer-ruby-and-rails

Test against Ruby 2.2 and Rails 4.2
master
Dmitrii Golub 9 years ago
parent
commit
d1d4fe3412
  1. 2
      .travis.yml
  2. 4
      Gemfile
  3. 2
      spec/lib/two_factor_authentication/models/two_factor_authenticatable_spec.rb
  4. 8
      spec/rails_app/config/environments/test.rb

2
.travis.yml

@ -4,12 +4,14 @@ env:
- "RAILS_VERSION=3.2.0"
- "RAILS_VERSION=4.0.0"
- "RAILS_VERSION=4.1.1"
- "RAILS_VERSION=4.2.4"
- "RAILS_VERSION=master"
rvm:
- 1.9.3
- 2.0
- 2.1
- 2.2
matrix:
allow_failures:

4
Gemfile

@ -16,6 +16,10 @@ rails = case rails_version
gem "rails", rails
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.2.0')
gem "test-unit", "~> 3.0"
end
group :test do
gem "sqlite3"
end

2
spec/lib/two_factor_authentication/models/two_factor_authenticatable_spec.rb

@ -9,7 +9,7 @@ describe Devise::Models::TwoFactorAuthenticatable, '#otp_code' do
it "should return an error if no secret is set" do
expect {
subject
}.to raise_error
}.to raise_error Exception
end
context "secret is set" do

8
spec/rails_app/config/environments/test.rb

@ -9,7 +9,13 @@ Dummy::Application.configure do
config.eager_load = false
# Configure static asset server for tests with Cache-Control for performance
config.serve_static_assets = true
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2 ||
Rails::VERSION::MAJOR >= 5
config.serve_static_files = true
else
config.serve_static_assets = true
end
config.static_cache_control = "public, max-age=3600"
# Show full error reports and disable caching

Loading…
Cancel
Save