Skip to content

Commit 08cff64

Browse files
committed
Setup travis
1 parent 5142678 commit 08cff64

5 files changed

Lines changed: 37 additions & 9 deletions

File tree

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Rails:
55
Enabled: true
66

77
AllCops:
8-
TargetRubyVersion: 2.5
8+
TargetRubyVersion: 2.3
99
DisplayCopNames: true
1010
Exclude:
1111
- bin/**/*

.travis.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
11
---
2-
sudo: false
32
language: ruby
3+
sudo: false
44
cache: bundler
5+
before_install: gem install bundler -v 1.17
6+
before_script: RAILS_ENV=test bundle exec rake db:create db:schema:load
7+
58
rvm:
9+
- 2.2.10
10+
- 2.3.8
11+
- 2.4.6
12+
- 2.5.5
613
- 2.6.3
7-
before_install: gem install bundler -v 2.0.2
14+
15+
gemfile:
16+
- gemfiles/rails4.2_graphql1.8.gemfile
17+
- gemfiles/rails5.0_graphql1.8.gemfile
18+
- gemfiles/rails5.0_graphql1.9.gemfile
19+
- gemfiles/rails5.1_graphql1.8.gemfile
20+
- gemfiles/rails5.1_graphql1.9.gemfile
21+
- gemfiles/rails5.2_graphql1.8.gemfile
22+
- gemfiles/rails5.2_graphql1.9.gemfile
23+
24+
matrix:
25+
include:
26+
- gemfile: gemfiles/rails_edge_graphql_edge.gemfile
27+
rvm: 2.5.5
28+
- gemfile: gemfiles/rails_edge_graphql_edge.gemfile
29+
rvm: 2.6.3

graphql_devise.gemspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Gem::Specification.new do |spec|
2323
spec.require_paths = ['lib']
2424
spec.test_files = Dir['spec/**/*']
2525

26+
spec.required_ruby_version = '>= 2.2.0'
27+
2628
spec.add_dependency 'devise_token_auth', '>= 0.1.37'
2729
spec.add_dependency 'graphql', '> 1.8'
2830
spec.add_dependency 'rails', '> 4.0'

spec/dummy/config/application.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,9 @@ class Application < Rails::Application
2525
# Middleware like session, flash, cookies can be added back manually.
2626
# Skip views, helpers and assets when generating a new resource.
2727
# config.api_only = true
28+
29+
if Rails::VERSION::MAJOR >= 5 && Rails::VERSION::MINOR > 1
30+
config.active_record.sqlite3.represent_boolean_as_integer = true
31+
end
2832
end
2933
end

spec/requests/mutations/login_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
let(:password) { '12345678' }
77
let(:user) { create(:user, :confirmed, password: password) }
88
let(:query) do
9-
<<~GRAPHQL
9+
<<-GRAPHQL
1010
mutation {
1111
login(
1212
email: "#{user.email}",
@@ -27,7 +27,7 @@
2727
it 'return credentials in headers and user information' do
2828
expect(response).to include_auth_headers
2929
expect(user.reload.tokens.keys).to include(response.headers['client'])
30-
expect(json_response.dig(:data, :login)).to match(
30+
expect(json_response[:data][:login]).to match(
3131
success: true,
3232
errors: [],
3333
authenticable: { email: user.email }
@@ -40,7 +40,7 @@
4040

4141
it 'returns bad credentials error' do
4242
expect(response).not_to include_auth_headers
43-
expect(json_response.dig(:data, :login)).to match(
43+
expect(json_response[:data][:login]).to match(
4444
success: false,
4545
errors: ['Invalid login credentials. Please try again.'],
4646
authenticable: nil
@@ -54,7 +54,7 @@
5454

5555
it 'returns a must confirm account message' do
5656
expect(response).not_to include_auth_headers
57-
expect(json_response.dig(:data, :login)).to match(
57+
expect(json_response[:data][:login]).to match(
5858
success: false,
5959
errors: [
6060
"A confirmation email was sent to your account at '#{user.email}'. You must follow the instructions in the " \
@@ -70,7 +70,7 @@
7070

7171
it 'returns a must confirm account message' do
7272
expect(response).not_to include_auth_headers
73-
expect(json_response.dig(:data, :login)).to match(
73+
expect(json_response[:data][:login]).to match(
7474
success: false,
7575
errors: ['Your account has been locked due to an excessive number of unsuccessful sign in attempts.'],
7676
authenticable: nil
@@ -83,7 +83,7 @@
8383

8484
it 'returns a must confirm account message' do
8585
expect(response).not_to include_auth_headers
86-
expect(json_response.dig(:data, :login)).to match(
86+
expect(json_response[:data][:login]).to match(
8787
success: false,
8888
errors: ['Invalid login credentials. Please try again.' ],
8989
authenticable: nil

0 commit comments

Comments
 (0)