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

Brian iteration 2 #22

Merged
merged 5 commits into from
Nov 4, 2022
Merged

Brian iteration 2 #22

merged 5 commits into from
Nov 4, 2022

Conversation

Bphayes1200
Copy link
Collaborator

fix classes invoice and invoice_repository


def update_time
@updated_at = Time.now
end
Copy link

Choose a reason for hiding this comment

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

Layout/TrailingWhitespace: Trailing whitespace detected.

updated_invoice.update_time
end
updated_invoice
end
Copy link

Choose a reason for hiding this comment

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

Layout/TrailingWhitespace: Trailing whitespace detected.

updated_invoice.update_status(attributes[:status])
updated_invoice.update_time
end
updated_invoice
Copy link

Choose a reason for hiding this comment

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

Layout/IndentationConsistency: Inconsistent indentation detected.

if all_ids.include?(id)
updated_invoice = find_by_id(id)
if updated_invoice.status != nil
updated_invoice.update_status(attributes[:status])
Copy link

Choose a reason for hiding this comment

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

Layout/IndentationWidth: Use 2 (not 3) spaces for indentation.

updated_invoice
if all_ids.include?(id)
updated_invoice = find_by_id(id)
if updated_invoice.status != nil
Copy link

Choose a reason for hiding this comment

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

Layout/IndentationConsistency: Inconsistent indentation detected.
Style/NonNilCheck: Prefer !expression.nil? over expression != nil.

invoice_repo = InvoiceRepository.new(invoices)

expect(invoice_repo.all_ids).to eq([invoice_1.id, invoice_2.id, invoice_3.id])
end
Copy link

Choose a reason for hiding this comment

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

Layout/TrailingWhitespace: Trailing whitespace detected.

invoices = [invoice_1, invoice_2, invoice_3]
invoice_repo = InvoiceRepository.new(invoices)

expect(invoice_repo.all_ids).to eq([invoice_1.id, invoice_2.id, invoice_3.id])
Copy link

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [84/80]

it 'will return all ids' do
invoices = [invoice_1, invoice_2, invoice_3]
invoice_repo = InvoiceRepository.new(invoices)

Copy link

Choose a reason for hiding this comment

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

Layout/TrailingWhitespace: Trailing whitespace detected.

@@ -100,20 +100,23 @@
expect(invoice_repo.all).to eq([invoice_1, invoice_2, invoice_3, invoice_4])
end
end
describe "#all_ids" do
it 'will return all ids' do
Copy link

Choose a reason for hiding this comment

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

Layout/TrailingWhitespace: Trailing whitespace detected.

@@ -100,20 +100,23 @@
expect(invoice_repo.all).to eq([invoice_1, invoice_2, invoice_3, invoice_4])
end
end
describe "#all_ids" do
Copy link

Choose a reason for hiding this comment

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

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Layout/TrailingWhitespace: Trailing whitespace detected.

:status => "pending",
:created_at => Time.now,
:updated_at => Time.now
})
Copy link

Choose a reason for hiding this comment

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

Layout/IndentHash: Indent the right brace the same as the first position after the preceding left parenthesis.

:merchant_id => 8,
:status => "pending",
:created_at => Time.now,
:updated_at => Time.now
Copy link

Choose a reason for hiding this comment

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

Style/HashSyntax: Use the new Ruby 1.9 hash syntax.

:customer_id => 7,
:merchant_id => 8,
:status => "pending",
:created_at => Time.now,
Copy link

Choose a reason for hiding this comment

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

Style/HashSyntax: Use the new Ruby 1.9 hash syntax.

:id => 6,
:customer_id => 7,
:merchant_id => 8,
:status => "pending",
Copy link

Choose a reason for hiding this comment

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

Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

i = Invoice.new({
:id => 6,
:customer_id => 7,
:merchant_id => 8,
Copy link

Choose a reason for hiding this comment

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

Style/HashSyntax: Use the new Ruby 1.9 hash syntax.

end

describe '#update_time' do
it 'will update time' do
Copy link

Choose a reason for hiding this comment

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

Layout/TrailingWhitespace: Trailing whitespace detected.

end
end

describe '#update_time' do
Copy link

Choose a reason for hiding this comment

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

Layout/TrailingWhitespace: Trailing whitespace detected.

expect(i.status).to eq("paid")
expect(i.status).to eq("paid")
end
end
Copy link

Choose a reason for hiding this comment

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

Layout/BlockAlignment: end at 86, 2 is not aligned with describe '#update_status' do at 71, 3.
Layout/TrailingWhitespace: Trailing whitespace detected.

@@ -81,7 +81,24 @@

i.update_status("paid")

expect(i.status).to eq("paid")
expect(i.status).to eq("paid")
end
Copy link

Choose a reason for hiding this comment

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

Layout/TrailingWhitespace: Trailing whitespace detected.

@@ -81,7 +81,24 @@

i.update_status("paid")

expect(i.status).to eq("paid")
expect(i.status).to eq("paid")
Copy link

Choose a reason for hiding this comment

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

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

@Kerynn Kerynn merged commit 3be7669 into master Nov 4, 2022
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