-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
|
||
def update_time | ||
@updated_at = Time.now | ||
end |
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.
Layout/TrailingWhitespace: Trailing whitespace detected.
updated_invoice.update_time | ||
end | ||
updated_invoice | ||
end |
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.
Layout/TrailingWhitespace: Trailing whitespace detected.
updated_invoice.update_status(attributes[:status]) | ||
updated_invoice.update_time | ||
end | ||
updated_invoice |
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.
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]) |
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.
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 |
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.
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 |
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.
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]) |
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.
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) | ||
|
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.
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 |
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.
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 |
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.
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 | ||
}) |
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.
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 |
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.
Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
:customer_id => 7, | ||
:merchant_id => 8, | ||
:status => "pending", | ||
:created_at => Time.now, |
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.
Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
:id => 6, | ||
:customer_id => 7, | ||
:merchant_id => 8, | ||
:status => "pending", |
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.
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, |
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.
Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
end | ||
|
||
describe '#update_time' do | ||
it 'will update time' do |
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.
Layout/TrailingWhitespace: Trailing whitespace detected.
end | ||
end | ||
|
||
describe '#update_time' do |
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.
Layout/TrailingWhitespace: Trailing whitespace detected.
expect(i.status).to eq("paid") | ||
expect(i.status).to eq("paid") | ||
end | ||
end |
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.
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 |
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.
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") |
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.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
fix classes invoice and invoice_repository