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

Resource recommendation #1

Open
wants to merge 70 commits into
base: master
Choose a base branch
from
Open

Conversation

AlineRibeiro
Copy link

Description

More Details

Corresponding Issue

Screenshots


Reviewing this pull request? Check out our Code Review Practices guide if you haven't already!

@@ -0,0 +1,34 @@
describe MomentKeywords do
subject(:moment) {FactoryBot.build(:moment,

Choose a reason for hiding this comment

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

This must be let as it does not refer to the tested class (MomentKeywords)

Suggested change
subject(:moment) {FactoryBot.build(:moment,
let(:moment) {FactoryBot.build(:moment,

Comment on lines 2 to 8
subject(:moment) {FactoryBot.build(:moment,
categories: [build(:category, name: 'free', description: 'Description')],
moods: [build(:mood, name: 'Name', description: 'Blog^^')],
strategies: [build(:strategy, name: 'Name', description: 'books@!##.')],
name: "ADDICTION",
why: "self-care.",
fix: "@Teachers!!" )}

Choose a reason for hiding this comment

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

The most accepted style for multiline blocks is using do...end:

Suggested change
subject(:moment) {FactoryBot.build(:moment,
categories: [build(:category, name: 'free', description: 'Description')],
moods: [build(:mood, name: 'Name', description: 'Blog^^')],
strategies: [build(:strategy, name: 'Name', description: 'books@!##.')],
name: "ADDICTION",
why: "self-care.",
fix: "@Teachers!!" )}
subject(:moment) do
FactoryBot.build(
:moment,
categories: [build(:category, name: 'free', description: 'Description')],
moods: [build(:mood, name: 'Name', description: 'Blog^^')],
strategies: [build(:strategy, name: 'Name', description: 'books@!##.')],
name: "ADDICTION",
why: "self-care.",
fix: "@Teachers!!"
)
end

why: "self-care.",
fix: "@Teachers!!" )}

let(:keywords) { MomentKeywords.new(moment).extract_moment_keywords }

Choose a reason for hiding this comment

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

It it refers to the class being testes (MomentKeywords), this needs to be the subject

Suggested change
let(:keywords) { MomentKeywords.new(moment).extract_moment_keywords }
subject(:keywords) { MomentKeywords.new(moment).extract_moment_keywords }

@@ -0,0 +1,22 @@
describe ResourceRecommendation do
subject(:moment) {FactoryBot.build(:moment,

Choose a reason for hiding this comment

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

Suggested change
subject(:moment) {FactoryBot.build(:moment,
let(:moment) {FactoryBot.build(:moment,

why: 'text',
fix: 'text' )}

let(:resources) { ResourceRecommendation.new(moment).resources}

Choose a reason for hiding this comment

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

Suggested change
let(:resources) { ResourceRecommendation.new(moment).resources}
subject(:resources) { ResourceRecommendation.new(moment).resources}

Comment on lines +30 to +34
end




Choose a reason for hiding this comment

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

These extra empty lines must be removed

@guialbuk
Copy link

It looks good! 👍 Almost there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants