Skip to content

Amy's Chitter#233

Open
Amy-O wants to merge 5 commits into
makersacademy:mainfrom
Amy-O:main
Open

Amy's Chitter#233
Amy-O wants to merge 5 commits into
makersacademy:mainfrom
Amy-O:main

Conversation

@Amy-O

@Amy-O Amy-O commented Jul 15, 2022

Copy link
Copy Markdown

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!

@erb16 erb16 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think your code is easy to follow and nicely organised!

Comment thread lib/peep.rb
connection = PG.connect(dbname: 'chitter')
result = connection.exec("SELECT * FROM peeps;")
result.map { |peep| peep['message'] }
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

class follows the single responsibility principle

"result": {
"line": 100.0
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What does this do?

Comment thread app.rb
connection = PG.connect(dbname: 'chitter')
connection.exec("INSERT INTO peeps (message) VALUES('#{peep}')")
redirect '/'
p "Peep sent!"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

everything clear and neatly laid out

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

no repetitions either

expect(page).to have_content "It is a bit warm!"
end
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think this should pass!

@siellsiell siellsiell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey Amy,

This is a good start to the challenge. You've demonstrated that you can read and write to the database from a web app. To make your code easier to test, it would be beneficial to have a test database. I left some more detailed comments below.

I saw that there were some bits that you were probably planning on doing but didn't get to. Was this a matter of time or did you find yourself getting blocked somewhere?

If you have any questions, feel free to answer in the comments on here or DM me.

Simo

Comment thread app.rb
Comment on lines -4 to -5
get '/test' do
'Test page'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice! It's always a good idea to remove test code from code you submit for code review (anywhere, not just at Makers). Make sure you remember to also remove code you added for debugging.

Comment thread app.rb
Comment on lines +16 to +17
connection = PG.connect(dbname: 'chitter')
connection.exec("INSERT INTO peeps (message) VALUES('#{peep}')")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since you already have aPeep class, it would make sense for this code to be part of that class. I see you already have a method in there called Peep.create, which would be a good place to put it.

click_button('Peep')
expect(page).to have_content "It is a bit warm!"
end
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice feature tests! It would be good to see a unit test for your Peep class as well so that you can test it in isolation.

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.

3 participants