Chitter Challenge - Rhys#212
Conversation
| it 'returns all peeps' do | ||
| connection = PG.connect(dbname: 'chitter_test') | ||
|
|
||
| # connection.exec("INSERT INTO peeps (message) VALUES('Hey, Welcome to my chitter page');") |
There was a problem hiding this comment.
Best to delete old notes if not required
siellsiell
left a comment
There was a problem hiding this comment.
Hey, it's Simo, a coach. I've reviewed your code and left a few comments below. Do ask if you have any questions.
| get '/new_peep' do | ||
| erb :new_peep | ||
| end |
There was a problem hiding this comment.
If you'd like to use more standard names for you routes, check out this blog post on RESTful routing: https://medium.com/@shubhangirajagrawal/the-7-restful-routes-a8e84201f206
| @@ -0,0 +1 @@ | |||
| ALTER TABLE peeps ADD COLUMN peep_date DATE DEFAULT CURRENT_DATE; No newline at end of file | |||
There was a problem hiding this comment.
Good use of the DATE column type!
| if ENV['ENVIRONMENT'] == 'test' | ||
| connection = PG.connect(dbname: 'chitter_test') | ||
| else | ||
| connection = PG.connect(dbname: 'chitter') | ||
| end |
There was a problem hiding this comment.
This piece of code appears twice in this file. How might you remove this duplication?
| # def self.filter(filter:) | ||
| # if ENV['ENVIRONMENT'] == 'test' | ||
| # connection = PG.connect(dbname: 'chitter_test') | ||
| # else | ||
| # connection = PG.connect(dbname: 'chitter') | ||
| # end | ||
|
|
||
| # connection.exec_params("SELECT * FROM peeps WHERE peeps.message LIKE '%#{filter}%'") | ||
| # end |
There was a problem hiding this comment.
It's always a good idea to remove commented out code from code you submit for code review (anywhere, not just at Makers)
| expect(page).to have_content('Today was a great day') | ||
| expect(page).to have_content('Today was a greater day') | ||
| expect(page).to have_content('Today was the greatest day') |
There was a problem hiding this comment.
Since you added the date feature, there should also be a feature test for that.
| fill_in('message', with: 'Today was a great day') | ||
| click_button('Post') | ||
|
|
||
| expect(page).to have_content("Today was a great day") |
…ry 3
Rhys
Please write your full name here to make it easier to find your pull request.
User stories
Please list which user stories you've implemented (delete the ones that don't apply).
README checklist
Does your README contains instructions for
Here is a pill that can help you write a great README!