Commit 7a71c0f1 authored by Toon Claes's avatar Toon Claes

spec: Cleanup custom emoji factory

The CustomEmoji factory was creating a namespace *and* a group, that
shouldn't have. Also the creator was set to nil by default, that's also
not good.
parent 4300b228
......@@ -3,9 +3,8 @@
FactoryBot.define do
factory :custom_emoji, class: 'CustomEmoji' do
sequence(:name) { |n| "custom_emoji#{n}" }
namespace
group
file { 'https://gitlab.com/images/partyparrot.png' }
creator { namespace.owner }
creator factory: :user
end
end
......@@ -38,7 +38,7 @@ RSpec.describe CustomEmoji do
new_emoji = build(:custom_emoji, name: old_emoji.name, namespace: old_emoji.namespace, group: group)
expect(new_emoji).not_to be_valid
expect(new_emoji.errors.messages).to eq(creator: ["can't be blank"], name: ["has already been taken"])
expect(new_emoji.errors.messages).to eq(name: ["has already been taken"])
end
it 'disallows non http and https file value' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment