From aa78cb522b0465751d4455306b36ebccf52c4fba Mon Sep 17 00:00:00 2001 From: Nikita Bulaj Date: Sun, 3 Sep 2017 14:05:19 +0300 Subject: [PATCH] Fix specs --- spec/mixins/active_record/client_spec.rb | 6 +++--- spec/mixins/mongoid/client_spec.rb | 6 +++--- spec/mixins/sequel/client_spec.rb | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/mixins/active_record/client_spec.rb b/spec/mixins/active_record/client_spec.rb index 3ce41ca..36ad77e 100644 --- a/spec/mixins/active_record/client_spec.rb +++ b/spec/mixins/active_record/client_spec.rb @@ -93,12 +93,12 @@ end it 'delete all the associated access tokens on destroy' do - user = User.create!(name: 'John', password: '123123') + user = User.create!(username: 'John', password: '123123') app = Application.create!(name: 'app1', redirect_uri: 'https://google.com') - 3.times { AccessToken.create(resource_ownder_id: user.id, client_id: app.id) } + 3.times { AccessToken.create(resource_owner_id: user.id, client_id: app.id) } - expect { app.reload.destroy }.to change { app.reload.access_tokens.count }.from(3).to(0) + expect { app.reload.destroy }.to change { AccessToken.count }.from(3).to(0) end end end diff --git a/spec/mixins/mongoid/client_spec.rb b/spec/mixins/mongoid/client_spec.rb index 108410c..5bc0df9 100644 --- a/spec/mixins/mongoid/client_spec.rb +++ b/spec/mixins/mongoid/client_spec.rb @@ -93,12 +93,12 @@ end it 'delete all the associated access tokens on destroy' do - user = User.create(name: 'John', password: '123123') + user = User.create(username: 'John', password: '123123') app = Application.create(name: 'app1', redirect_uri: 'https://google.com') - 3.times { AccessToken.create(resource_ownder_id: user.id, client_id: app.id) } + 3.times { AccessToken.create(resource_owner_id: user.id, client_id: app.id) } - expect { app.reload.destroy }.to change { app.reload.access_tokens.count }.from(3).to(0) + expect { app.reload.destroy }.to change { AccessToken.count }.from(3).to(0) end end end diff --git a/spec/mixins/sequel/client_spec.rb b/spec/mixins/sequel/client_spec.rb index ecf146d..cc4b985 100644 --- a/spec/mixins/sequel/client_spec.rb +++ b/spec/mixins/sequel/client_spec.rb @@ -94,12 +94,12 @@ end it 'delete all the associated access tokens on destroy' do - user = User.create(name: 'John', password: '123123') + user = User.create(username: 'John', password: '123123') app = Application.create(name: 'app1', redirect_uri: 'https://google.com') - 3.times { AccessToken.create(resource_ownder_id: user.id, client_id: app.id) } + 3.times { AccessToken.create(resource_owner_id: user.id, client_id: app.id) } - expect { app.reload.destroy }.to change { app.reload.access_tokens.count }.from(3).to(0) + expect { app.refresh.destroy }.to change { AccessToken.count }.from(3).to(0) end end end