Q Chitter Challenge #2178
Conversation
…se connection error
umutbaykan
left a comment
There was a problem hiding this comment.
sorry about the grammar and tone, we were in a rush! :)
| new_peep = Peep.new( | ||
| id: peep['id'].to_i, | ||
| content: peep['content'], | ||
| user_id: peep['user_id'].to_i, | ||
| created_at: peep['created_at'] | ||
| ) |
There was a problem hiding this comment.
new_peep = Peep.new
new_peep.id = peep['id'].to_i..
etc. etc.
|
|
||
| new_peep | ||
| end | ||
| end |
There was a problem hiding this comment.
return result before the def all method finishes (ends)
lib/peeps_repository.rb
Outdated
| # Debug statement | ||
| # puts "Peep created_at: #{new_peep.created_at.inspect}" | ||
|
|
||
| new_peep |
| "Hello, world!" | ||
| ] | ||
|
|
||
| actual_peeps = response.body.scan(/<p class="peep__content">(.+)<\/p>/).flatten |
There was a problem hiding this comment.
I think we need additional tests to check for format of peeps, as in they include the username, time etc..
spec/integration/chitter_app_spec.rb
Outdated
|
|
||
| expected_username = "orangeman" | ||
| actual_username = response.body.scan(/<p class="peep__username">(.+)<\/p>/).flatten.first | ||
|
|
There was a problem hiding this comment.
maybe we can add one more test to check full format of one peep?
| def reset_tables | ||
| seed_sql = File.read('spec/seeds/chitter_seed.sql') | ||
| connection = PG.connect({ host: '127.0.0.1', dbname: 'chitter_test' }) | ||
| connection.exec(seed_sql) | ||
| end |
There was a problem hiding this comment.
same method happens in user repo tests, can we move those two to a singular location to have control from a single point?
| email: user['email'] | ||
| ) | ||
| end | ||
| end |
There was a problem hiding this comment.
would be nice to see return result to clarify what it is returning
| TRUNCATE TABLE users, peeps, notifications RESTART IDENTITY; | ||
|
|
There was a problem hiding this comment.
unrelated to this file, but would be good to see the create table sql file in here as well
| require 'users' | ||
| require 'users_repository' | ||
|
|
||
| def reset_tables |
…ke sure font matches
No description provided.