summaryrefslogtreecommitdiff
path: root/spec/models/concerns/feature_gate_spec.rb
blob: 6106708a32d715469298efc238d8bd421b3ac385 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe FeatureGate do
  describe 'User' do
    describe '#flipper_id' do
      context 'when user is not persisted' do
        let(:user) { build(:user) }

        it { expect(user.flipper_id).to be_nil }
      end

      context 'when user is persisted' do
        let(:user) { create(:user) }

        it { expect(user.flipper_id).to eq "User:#{user.id}" }
      end
    end
  end
end