2019-03-30 03:23:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-06-27 12:58:56 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 14:09:03 -04:00
|
|
|
RSpec.describe FeatureGate do
|
2017-06-27 12:58:56 -04:00
|
|
|
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
|