-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add submissions and reviews to panel #651
Conversation
factory :published_grant, traits: %i[published] | ||
factory :open_grant_with_users, traits: %i[published open with_users] | ||
factory :closed_grant_with_users, traits: %i[closed with_users] | ||
factory :published_open_grant, traits: %i[published open] | ||
factory :published_open_grant_with_users, traits: %i[published open with_users_and_submission_form with_panel] | ||
factory :published_closed_grant, traits: %i[published closed] | ||
factory :published_closed_grant_with_users, traits: %i[published closed with_users] | ||
factory :published_closed_grant_with_users, traits: %i[published closed with_users_and_submission_form with_submission with_reviewer with_panel] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these factory names seem a little arbitrary and they don't always indicate the traits they contain. For example, :grant_with_users and :draft_grant_with_users have panel, but neither does :new_grant_with_users nor ::open_grant_with_users. As I suggested in chat, instead of creating a new factory for each different combination, how about add traits when actually constructing an instance in specs? See my comments in spec/system/panels/submissions/submission_spec.rb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, the names are now convoluted. i'm a bit reluctant to go the route you suggest because a panel is now created on grant creation.
i think the whole file needs to be reworked given current state of the app rather than the add-as-we-go model we've been using.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be dealing w/ factory clean up in #644
include UsersHelper | ||
|
||
RSpec.describe 'Panel Submission Reviews', type: :system, js: true do | ||
let!(:grant) { create(:grant_with_users) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest:
let!(:grant) { create(:published_grant, :with_users_and_submission_form, :with_panel) }
see https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md#using-traits for using traits while constructing instances
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be dealing w/ factory clean up in #644
No description provided.