Skip to content

first version#216

Open
Leigh-Rose wants to merge 1 commit into
makersacademy:mainfrom
Leigh-Rose:main
Open

first version#216
Leigh-Rose wants to merge 1 commit into
makersacademy:mainfrom
Leigh-Rose:main

Conversation

@Leigh-Rose
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!

@ghost
Copy link
Copy Markdown

ghost commented Apr 4, 2022

Nice use of user prompt in ‘new peeps’ form ‘Please enter a new peep below:’

App has also been secured with the use of exec_params

code is well laid out & easy to read - unnecessary files have been removed to make the files clear (such as the pre-given test page spec)

Naming clear for files such as view/add

Comment thread app.rb
get '/test' do
'Test page'

# get '/' do
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 would probably try to avoid leaving commented out code in your code base, either you need that redirect or you don't

Comment thread app.rb
# redirect '/chitter/peeps'
# end

get '/chitter/peeps' do
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It looks like you tried to organise your routes, however the best way to do this is with a system we call REST. For example with your routes as they are now you would presumably have /chitter/ in front of everything making it unhelpful bloat, and peeps is a bit generic and doesn't give any indication of what that route is for. Perhaps something like get '/peeps' for the landing page and then post '/peeps/new' might be a better solution for your other route. This way we know that these routes are for peeps and that one of them is to create a new one.

Comment thread lib/peeps.rb
end

def self.all
if ENV['ENVIRONMENT'] == 'test'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This if else is going to be needed in any function you create and it already adds quite a lot of bloat with just two at the moment, could you extract that into a separate function?

@tomfuller
Copy link
Copy Markdown

Overall this is a nice solution to the problem, well done! I have left some comments where there are a couple things that could be improved, but I also wanted to call out that while having the UI tests is great it would also be good to have unit tests testing your individual functions. If you have any questions about any of the feedback let me know and Im happy to chat it through 😄

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.

2 participants