Fix flaky organization helper spec (#7785)

This commit is contained in:
Michael Kohl 2020-05-12 18:20:05 +07:00 committed by GitHub
parent d60fee2196
commit d10888bfa5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,13 +1,13 @@
require "rails_helper"
describe OrganizationHelper, type: :helper do
it "display the correct options" do
org1 = create(:organization)
org2 = create(:organization)
it "displays the correct options" do
org1 = create(:organization, name: "ACME")
org2 = create(:organization, name: "Pied Piper")
allow(org1).to receive(:unspent_credits_count).and_return(1)
options = helper.orgs_with_credits([org1, org2])
expect(options).to include("#{org1.name} (1)")
expect(options).to include("#{org2.name} (0)")
expect(options).to include("ACME (1)")
expect(options).to include("Pied Piper (0)")
end
end