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

adding and displaying peeps #213

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bradleydeakin
Copy link

Your name

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).

  • User story 1: "I want to see all the messages (peeps) in a browser"
  • User story 2: "I want to post a message (peep) to chitter"
  • User story 3: "I want to see the date the message was posted"
  • User story 4: "I want to see a list of peeps in reverse chronological order"
  • User story 5: "I want to filter on a specific keyword"

README checklist

Does your README contains instructions for

  • how to install,
  • how to run,
  • and how to test your code?

Here is a pill that can help you write a great README!

Copy link
Contributor

@siellsiell siellsiell left a comment

Choose a reason for hiding this comment

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

Hey, it's Simo, a coach. I've reviewed your code and left a few comments below. Do ask if you have any questions.

Comment on lines +10 to +22
get '/peeps' do
@peeps_return = Peep.all
erb :peeps
end

get '/peeps/post' do
erb :post
end

post '/peeps/new' do
Peep.post(params[:message])
redirect '/peeps'
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Your routs are quite close to the standard RESTful routing conventions, but not quite! 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

Comment on lines 23 to 25
get '/test' do
'Test page'
end
Copy link
Contributor

Choose a reason for hiding this comment

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

It's always a good idea to remove test code from code you submit for code review (anywhere, not just at Makers)

Comment on lines +17 to +21
if ENV['ENVIRONMENT'] == 'test'
connection = PG.connect(dbname: 'chitter_test')
else
connection = PG.connect(dbname: 'chitter')
end
Copy link
Contributor

Choose a reason for hiding this comment

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

This piece of code appears twice in this file. How might you remove this duplication?

end
def test_data_script

p "setting up test chitter"
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, remove test code.

require 'pg'
require 'peep'

feature 'viewing peeps' do
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice feature tests!

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.

None yet

2 participants