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

Amy's Chitter #233

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Amy's Chitter #233

wants to merge 5 commits into from

Conversation

Amy-O
Copy link

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

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

@erb16 erb16 left a comment

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!

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

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

Choose a reason for hiding this comment

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

What does this do?

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

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

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

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!

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 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 on lines -4 to -5
get '/test' do
'Test page'
Copy link
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 on lines +16 to +17
connection = PG.connect(dbname: 'chitter')
connection.exec("INSERT INTO peeps (message) VALUES('#{peep}')")
Copy link
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
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.

None yet

3 participants