Skip to content

Commit

Permalink
Demonstrate AR adapter not working when table doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Dec 11, 2023
1 parent 4e34ee7 commit b75bf78
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/flipper/adapters/active_record_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@

it_should_behave_like 'a flipper adapter'

fit "works when table doesn't exist" do
ActiveRecord::Base.connection.execute("DROP table IF EXISTS `flipper_gates`")

Flipper.configuration = nil
Flipper.instance = nil

silence_warnings { load 'flipper/adapters/active_record.rb' }
expect { Flipper::Adapters::ActiveRecord.new }.not_to raise_error
end

it "should load actor ids fine" do
flipper.enable_percentage_of_time(:foo, 1)

Expand Down

0 comments on commit b75bf78

Please sign in to comment.