diff options
author | Rémy Coutable <remy@rymai.me> | 2017-03-23 16:08:39 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-04-03 19:54:48 +0300 |
commit | 4e3516788fdea3de3c5f06e1981ddc518b05d0fb (patch) | |
tree | d83183c2dfb8c5082a9d5a9fbcda6a5479c7d9fd /spec/features/issuables | |
parent | ca6a7f1e9c9296317315249de9b8b3803d1c6ddc (diff) |
Don't use FFaker in factories, use sequences instead
FFaker can generate data that randomly break our test suite. This
simplifies our factories and use sequences which are more predictive.
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/features/issuables')
-rw-r--r-- | spec/features/issuables/issuable_list_spec.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/spec/features/issuables/issuable_list_spec.rb b/spec/features/issuables/issuable_list_spec.rb index b90bf6268fd..f324354dd46 100644 --- a/spec/features/issuables/issuable_list_spec.rb +++ b/spec/features/issuables/issuable_list_spec.rb @@ -46,16 +46,16 @@ describe 'issuable list', feature: true do end def create_issuables(issuable_type) - 3.times do + 3.times do |n| issuable = if issuable_type == :issue create(:issue, project: project, author: user) else - create(:merge_request, title: FFaker::Lorem.sentence, source_project: project, source_branch: FFaker::Name.name) + create(:merge_request, source_project: project, source_branch: "#{n}-feature") end 2.times do - create(:note_on_issue, noteable: issuable, project: project, note: 'Test note') + create(:note_on_issue, noteable: issuable, project: project) end create(:award_emoji, :downvote, awardable: issuable) @@ -65,9 +65,8 @@ describe 'issuable list', feature: true do if issuable_type == :issue issue = Issue.reorder(:iid).first merge_request = create(:merge_request, - title: FFaker::Lorem.sentence, source_project: project, - source_branch: FFaker::Name.name) + source_branch: 'my-bug-fix') MergeRequestsClosingIssues.create!(issue: issue, merge_request: merge_request) end |