Skip to content

Commit

Permalink
container_summary_helper_spec: don't expect hash keys in specific order
Browse files Browse the repository at this point in the history
also don' expect `:image`, it can be `:icon` instead
  • Loading branch information
himdel committed Mar 7, 2017
1 parent 5b9f25d commit fd8628a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spec/helpers/container_summary_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe ContainerSummaryHelper do
let(:container_project) { FactoryGirl.create(:container_project) }
let(:rel_hash_with_link) { [:label, :image, :value, :link, :title] }
let(:rel_hash_without_link) { [:label, :image, :value] }
let(:rel_hash_with_link) { [:label, :value, :link, :title] }
let(:rel_hash_without_link) { [:label, :value] }

before do
self.class.send(:include, ApplicationHelper)
Expand All @@ -14,13 +14,13 @@

it 'show link when role allows' do
stub_user(:features => :all)
expect(subject.keys).to eq(rel_hash_with_link)
expect(subject.keys).to include(*rel_hash_with_link)
expect(subject[:value]).to eq(container_project.name)
end

it 'hide link when role does not allow' do
stub_user(:features => :none)
expect(subject.keys).to eq(rel_hash_without_link)
expect(subject.keys).to include(*rel_hash_without_link)
expect(subject[:value]).to eq(container_project.name)
end
end
Expand All @@ -31,13 +31,13 @@

it 'show link when role allows' do
stub_user(:features => :all)
expect(subject.keys).to eq(rel_hash_with_link)
expect(subject.keys).to include(*rel_hash_with_link)
expect(subject[:value]).to eq("2")
end

it 'hide link when role does not allow' do
stub_user(:features => :none)
expect(subject.keys).to eq(rel_hash_without_link)
expect(subject.keys).to include(*rel_hash_without_link)
expect(subject[:value]).to eq("2")
end
end
Expand Down

0 comments on commit fd8628a

Please sign in to comment.