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

Add submissions and reviews to panel #651

Merged
merged 25 commits into from
Oct 22, 2020
Merged

Conversation

jseraf
Copy link
Collaborator

@jseraf jseraf commented Oct 20, 2020

No description provided.

@jseraf jseraf added the panel label Oct 20, 2020
@jseraf jseraf self-assigned this Oct 20, 2020
app/views/panels/show.html.haml Outdated Show resolved Hide resolved
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]
Copy link
Contributor

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

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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) }
Copy link
Contributor

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

Copy link
Collaborator Author

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

@jseraf jseraf changed the title Add submissions to panel Add submissions and reviews to panel Oct 21, 2020
@jseraf jseraf marked this pull request as ready for review October 21, 2020 19:42
@jseraf jseraf requested a review from fanglinnw October 21, 2020 19:42
@jseraf jseraf merged commit abb5b67 into feature/panels Oct 22, 2020
@jseraf jseraf deleted the add-submissions-to-panel branch October 28, 2020 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants