spec/unit/batch_actions/settings_spec.rb in activeadmin-0.6.6 vs spec/unit/batch_actions/settings_spec.rb in activeadmin-1.0.0.pre1
- old
+ new
@@ -1,61 +1,61 @@
-require 'spec_helper'
+require 'rails_helper'
describe "Batch Actions Settings" do
let(:app) { ActiveAdmin::Application.new }
let(:ns) { ActiveAdmin::Namespace.new(app, "Admin") }
let(:post_resource) { ns.register Post }
it "should be disabled globally by default" do
# Note: the default initializer would set it to true
- app.batch_actions.should be_false
- ns.batch_actions.should be_false
- post_resource.batch_actions_enabled?.should be_false
+ expect(app.batch_actions).to be_falsey
+ expect(ns.batch_actions).to be_falsey
+ expect(post_resource.batch_actions_enabled?).to be_falsey
end
it "should be settable to true" do
app.batch_actions = true
- app.batch_actions.should == true
+ expect(app.batch_actions).to be_truthy
end
it "should be an inheritable_setting" do
app.batch_actions = true
- ns.batch_actions.should == true
+ expect(ns.batch_actions).to be_truthy
end
it "should be settable at the namespace level" do
app.batch_actions = true
ns.batch_actions = false
- app.batch_actions.should == true
- ns.batch_actions.should == false
+ expect(app.batch_actions).to be_truthy
+ expect(ns.batch_actions).to be_falsey
end
it "should be settable at the resource level" do
- post_resource.batch_actions_enabled?.should == false
+ expect(post_resource.batch_actions_enabled?).to be_falsey
post_resource.batch_actions = true
- post_resource.batch_actions_enabled?.should == true
+ expect(post_resource.batch_actions_enabled?).to be_truthy
end
it "should inherit the setting on the resource from the namespace" do
ns.batch_actions = false
- post_resource.batch_actions_enabled?.should == false
- post_resource.batch_actions.should be_empty
+ expect(post_resource.batch_actions_enabled?).to be_falsey
+ expect(post_resource.batch_actions).to be_empty
post_resource.batch_actions = true
- post_resource.batch_actions_enabled?.should == true
- post_resource.batch_actions.should_not be_empty
+ expect(post_resource.batch_actions_enabled?).to be_truthy
+ expect(post_resource.batch_actions).to_not be_empty
end
it "should inherit the setting from the namespace when set to nil" do
ns.batch_actions = true
post_resource.batch_actions = true
- post_resource.batch_actions_enabled?.should == true
- post_resource.batch_actions.should_not be_empty
+ expect(post_resource.batch_actions_enabled?).to be_truthy
+ expect(post_resource.batch_actions).to_not be_empty
post_resource.batch_actions = nil
- post_resource.batch_actions_enabled?.should == true # inherited from namespace
- post_resource.batch_actions.should_not be_empty
+ expect(post_resource.batch_actions_enabled?).to be_truthy # inherited from namespace
+ expect(post_resource.batch_actions).to_not be_empty
end
end