spec/graphql/query/identity_provider_spec.rb in osso-0.0.3.6 vs spec/graphql/query/identity_provider_spec.rb in osso-0.0.3.7
- old
+ new
@@ -3,10 +3,11 @@
require 'spec_helper'
describe Osso::GraphQL::Schema do
describe 'Identity Provider' do
let(:id) { Faker::Internet.uuid }
+ let(:domain) { Faker::Internet.domain_name }
let(:variables) { { id: id } }
let(:query) do
<<~GRAPHQL
query IdentityProvider($id: ID!) {
identityProvider(id: $id) {
@@ -22,11 +23,11 @@
GRAPHQL
end
before do
create(:identity_provider)
- create(:identity_provider, id: id)
+ create(:identity_provider, id: id, domain: domain)
end
subject do
described_class.execute(
query,
@@ -41,21 +42,23 @@
expect(subject['errors']).to be_nil
expect(subject.dig('data', 'identityProvider', 'id')).to eq(id)
end
end
- xdescribe 'for an email scoped user' do
+ describe 'for an email scoped user' do
let(:current_scope) { domain }
+
it 'returns Enterprise Account for domain' do
expect(subject['errors']).to be_nil
- expect(subject.dig('data', 'enterpriseAccount', 'domain')).to eq(domain)
+ expect(subject.dig('data', 'identityProvider', 'domain')).to eq(domain)
end
end
- xdescribe 'for the wrong email scoped user' do
+ describe 'for the wrong email scoped user' do
let(:current_scope) { 'bar.com' }
+
it 'returns Enterprise Account for domain' do
- expect(subject['errors']).to be_nil
+ expect(subject['errors']).to_not be_empty
expect(subject.dig('data', 'enterpriseAccount')).to be_nil
end
end
end
end