Sha256: 9ef0d912181a2af61fa00beed19e70011b8e8c8ab1e6a401b392ca0a7b77ec02
Contents?: true
Size: 1.22 KB
Versions: 12
Compression:
Stored size: 1.22 KB
Contents
require 'rails_helper' # Engine.rb automatically includes the mixin RSpec.describe Doorkeeper::Application, :type => :model do describe "associations" do it { is_expected.to have_many(:sso_clients).class_name('Sso::Client').with_foreign_key(:application_id) } end describe "assignment" do let(:user) { Fabricate(:user) } let(:application) { Fabricate('Doorkeeper::Application') } let(:access_token) { Fabricate('Doorkeeper::AccessToken', resource_owner_id: user.id) } let(:access_grant) { Fabricate('Doorkeeper::AccessGrant', application_id: application.id, resource_owner_id: user.id, redirect_uri: 'http://localhost:3002/oauth/callback' ) } let(:session) { Fabricate('Sso::Session', owner: user) } let!(:client) { Fabricate('Sso::Client', session: session, application_id: application.id, access_token_id: access_token.id, access_grant_id: access_grant.id) } it { expect(application.sso_clients).to eq [ client ] } end end
Version data entries
12 entries across 12 versions & 1 rubygems