Browse Source

Test against Ruby 2.2 and Rails 4.2

Adds builds to the travisci matrix for Ruby 2.2 and Rails 4.2.4
Also fixes a couple of deprecation warnings that surface as part of
this change.
master
Paul Bowsher 9 years ago
parent
commit
7dd514a699
  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=3.2.0"
- "RAILS_VERSION=4.0.0" - "RAILS_VERSION=4.0.0"
- "RAILS_VERSION=4.1.1" - "RAILS_VERSION=4.1.1"
- "RAILS_VERSION=4.2.4"
- "RAILS_VERSION=master" - "RAILS_VERSION=master"
rvm: rvm:
- 1.9.3 - 1.9.3
- 2.0 - 2.0
- 2.1 - 2.1
- 2.2
matrix: matrix:
allow_failures: allow_failures:

4
Gemfile

@ -16,6 +16,10 @@ rails = case rails_version
gem "rails", rails gem "rails", rails
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.2.0')
gem "test-unit", "~> 3.0"
end
group :test do group :test do
gem "sqlite3" gem "sqlite3"
end 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 it "should return an error if no secret is set" do
expect { expect {
subject subject
}.to raise_error }.to raise_error Exception
end end
context "secret is set" do 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 config.eager_load = false
# Configure static asset server for tests with Cache-Control for performance # 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" config.static_cache_control = "public, max-age=3600"
# Show full error reports and disable caching # Show full error reports and disable caching

Loading…
Cancel
Save