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

first version #216

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

first version #216

wants to merge 1 commit into from

Conversation

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

@ShannonWL
Copy link

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

get '/test' do
'Test page'

# get '/' do

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

# redirect '/chitter/peeps'
# end

get '/chitter/peeps' do

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.

end

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

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

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.

3 participants