Fix admin/tags test avoiding the use of conditional

This commit is contained in:
Eduardo Martinez Echevarria
2017-06-23 15:00:02 +02:00
parent 8dd52110db
commit fd2c51d4b1

View File

@@ -8,16 +8,12 @@ feature 'Admin tags' do
end
scenario 'Index' do
create(:debate, tag_list: 'supertag')
debate_tag = ActsAsTaggableOn::Tag.find_by(name: "supertag")
debate = create(:debate)
debate.tag_list.add(create(:tag, :category, name: "supertag"))
visit admin_tags_path
expect(page).to have_content @tag1.name
if debate_tag.category?
expect(page).to have_content 'supertag'
else
expect(page).to_not have_content 'supertag'
end
expect(page).to have_content 'supertag'
end
scenario 'Create' do