Skip to content

Commit

Permalink
Silence ActiveRecord migration output during specs (#925)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski authored and nickcharlton committed Jul 5, 2017
1 parent 0b1637b commit bbc3b17
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions spec/generators/dashboard_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
require "generators/administrate/dashboard/dashboard_generator"

describe Administrate::Generators::DashboardGenerator, :generator do
around do |example|
ActiveRecord::Migration.suppress_messages do
example.run
end
end

describe "dashboard definition file" do
it "has valid syntax" do
dashboard = file("app/dashboards/customer_dashboard.rb")
Expand Down
4 changes: 3 additions & 1 deletion spec/generators/routes_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ class ModelWithoutDBTable < ActiveRecord::Base; end
end

it "skips models that don't have a named constant" do
ActiveRecord::Schema.define { create_table(:foos) }
ActiveRecord::Migration.suppress_messages do
ActiveRecord::Schema.define { create_table(:foos) }
end
_unnamed_model = Class.new(ActiveRecord::Base) do
def self.table_name
:foos
Expand Down

0 comments on commit bbc3b17

Please sign in to comment.