Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate news and member factories #9

Merged
merged 9 commits into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions spec/factories/news.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FactoryBot.define do

factory :news do
project
sequence(:title) {|n| 'News #' + n.to_s }
summary { 'Lorem Ipsum is simply dummy text' }
description { 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.' }
author
end

end
4 changes: 4 additions & 0 deletions spec/factories/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
factory :project do
transient do
number_of_issues { 0 }
number_of_members { 0 }
trackers { [] }
end

Expand All @@ -17,6 +18,9 @@
project.project_time_entry_activities = FactoryBot.create_list(:time_entry_activity, 1) if project.project_time_entry_activities.empty?

FactoryBot.create_list :issue, evaluator.number_of_issues, project: project
evaluator.number_of_members.times do
project.add_default_member(user)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing test for this line.

end
end

end
Expand Down
4 changes: 4 additions & 0 deletions spec/factory_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ def factories(names)
it { FactoryBot.lint factories(%i[issue issue_custom_field journal tracker issue_status issue_priority]) }
end

context "News" do
it { FactoryBot.lint factories(%i[news]) }
end

context "Project" do
it { FactoryBot.lint factories(%i[project role]) }
end
Expand Down