rails_api_auth 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,19 @@ describe Login do
3
3
  expect(subject).to belong_to(:account).with_foreign_key(:user_id)
4
4
  end
5
5
 
6
- it { is_expected.to validate_presence_of(:identification) }
6
+ subject { Login.new(identification: 'test@example.com', oauth2_token: 'token', single_use_oauth2_token: 'oldtoken') }
7
+
8
+ describe 'validations' do
9
+ before do
10
+ Login.any_instance.stub(:ensure_oauth2_token).and_return(true)
11
+ Login.any_instance.stub(:assign_single_use_oauth2_token).and_return(true)
12
+ end
13
+
14
+ it { is_expected.to validate_presence_of(:identification) }
15
+ it { is_expected.to validate_uniqueness_of(:identification) }
16
+ it { is_expected.to validate_uniqueness_of(:oauth2_token) }
17
+ it { is_expected.to validate_uniqueness_of(:single_use_oauth2_token) }
18
+ end
7
19
 
8
20
  it 'validates presence of either password or Facebook UID' do
9
21
  login = described_class.new(identification: 'test@example.com', oauth2_token: 'token')
@@ -2,8 +2,10 @@ ENV['RAILS_ENV'] ||= 'test'
2
2
 
3
3
  require 'simplecov'
4
4
  SimpleCov.start do ||
5
- minimum_coverage 95
6
- refuse_coverage_drop
5
+ unless defined?(JRUBY_VERSION) || defined?(JRuby)
6
+ minimum_coverage 95
7
+ refuse_coverage_drop
8
+ end
7
9
  end
8
10
 
9
11
  require File.expand_path('../dummy/config/environment.rb', __FILE__)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_api_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Otte-Witte
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-03-23 00:00:00.000000000 Z
12
+ date: 2016-05-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails