Sha256: b1fe6d2042a01858a043c839b9e0038aa95e052b7c58fdac41ac6db1e1fa949d

Contents?: true

Size: 608 Bytes

Versions: 5

Compression:

Stored size: 608 Bytes

Contents

# frozen_string_literal: true

require "rails_helper_for_engine"

RSpec.describe Omniauth::Rails::AuthorizationTypes::Regex do
  let(:email) { "foo@bar.com" }
  let(:regex) { /\Afo\w@bar.com\z/i }

  let(:subject) { Omniauth::Rails::AuthorizationTypes::Regex.new(email: email, value: regex) }

  describe "#authorized?" do
    context "a match" do
      it "returns true" do
        expect(subject.authorized?).to eq(true)
      end
    end

    context "a miss" do
      let(:email) { "baz@bar.com" }

      it "returns false" do
        expect(subject.authorized?).to eq(false)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
omniauth-rails-0.6.0 spec/models/omniauth/rails/authorization_types/regex_spec.rb
omniauth-rails-0.5.0 spec/models/omniauth/rails/authorization_types/regex_spec.rb
omniauth-rails-0.4.0 spec/models/omniauth/rails/authorization_types/regex_spec.rb
omniauth-rails-0.3.0 spec/models/omniauth/rails/authorization_types/regex_spec.rb
omniauth-rails-0.2.0 spec/models/omniauth/rails/authorization_types/regex_spec.rb