Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stub deprecations in tests when we expect a deprecation #2000

Merged
merged 1 commit into from
Nov 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions spec/helpers/blacklight_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,18 @@
end

it "is true" do
expect(Deprecation).to receive(:warn)
expect(helper.should_render_index_field?(double, double)).to be true
end

it "is false if the document doesn't have a value for the field" do
expect(Deprecation).to receive(:warn)
allow(helper).to receive_messages(document_has_value?: false)
expect(helper.should_render_index_field?(double, double)).to be false
end

it "is false if the configuration has the field disabled" do
expect(Deprecation).to receive(:warn)
allow(helper).to receive_messages(should_render_field?: false)
expect(helper.should_render_index_field?(double, double)).to be false
end
Expand All @@ -164,15 +167,18 @@
end

it "is true" do
expect(Deprecation).to receive(:warn)
expect(helper.should_render_show_field?(double, double)).to be true
end

it "is false if the document doesn't have a value for the field" do
expect(Deprecation).to receive(:warn)
allow(helper).to receive_messages(document_has_value?: false)
expect(helper.should_render_show_field?(double, double)).to be false
end

it "is false if the configuration has the field disabled" do
expect(Deprecation).to receive(:warn)
allow(helper).to receive_messages(should_render_field?: false)
expect(helper.should_render_show_field?(double, double)).to be false
end
Expand Down