Commit Graph

19 Commits (f81199e31b8b3311aa7fc4cdb4fd1780e1fb0ea7)

Author SHA1 Message Date
Adam Townsend 4f54124519 rubocop autofixed formatting 2023-10-22 13:13:27 -07:00
Adam Townsend 144731062b added URL validation to webpage part 2023-10-12 23:42:52 -07:00
Adam Townsend ae2360a480 include the proper status code 2023-10-12 23:31:15 -07:00
Adam Townsend c81a7a6160 added rescue for urls that don't resolve 2023-10-12 19:03:03 -07:00
Adam Townsend 7eaa8eacf8 added rescue for OpenURI HTTPErrors 2023-10-12 18:26:13 -07:00
Adam Townsend 1ae6c02472 rescue BadURIError for invalid URL format 2023-10-12 18:20:56 -07:00
Adam Townsend cabb4daded split up the nil? and empty? cases, because they are different
situations
2023-10-12 14:27:31 -07:00
Adam Townsend ac3e9f14cd added links route for API interactions 2023-10-12 11:42:43 -07:00
Adam Townsend 4a82174526 implemented API create endpoint
+ added plugins to read json and access the header to parse the request
  for an API request
+ fixed logic where url param is nil
+ refactored the new code to a variable to be reused easier
+ if CONTENT_TYPE header is application/json, reply with json
- there could be more refactoring (maybe separating it to a different
  endpoint) to handle other scenarios, we'll work on that later
2023-10-11 19:21:43 -07:00
Adam Townsend 5bce31baf2 refactored missing link scenario to make more sense
+ 404 code, stay on the current page, and load the form
+ also simplified the logic for the create action if the link doesn't
  already exist
2023-10-07 21:11:12 -07:00
Adam Townsend f8499a79c2 check if the link exists, redirects home if it doesn't 2023-10-07 13:38:10 -07:00
Adam Townsend b2b41f1aa1 added flash plugin
+ added flash plugin, and the session plugin required by flash
+ set the DB name as an environment variable
+ set @message variable where it needs to be set to show on the UI
2023-10-03 15:56:42 -07:00
Adam Townsend 445236d735 2nd scenario
+ added a scenario for submitting the button with no text  in url field
+ simplified the visit when clause to be used with any url
+ edited create route redirect if url param is empty (backend validation
  for required URL field)
+ added when clause for clicking submit button
+ added then clause for current path/page
2023-10-01 12:10:30 -07:00
Adam Townsend c0c82e5395 added some simple styles to make it nicer 2023-09-22 17:42:50 -07:00
Adam Townsend 47f8741592 added logic to prevent duplicate url's from being entered, it just
fetches the url and load it instead
2023-09-22 15:11:06 -07:00
Adam Townsend a3d7525d9a added rspec, rack test, and cucumber gems 2023-09-19 12:23:38 -07:00
Adam Townsend 1652107549 got app working reasonably well, and removed db file, that shouldn't be in the db 2023-09-14 22:30:33 -07:00
Adam Townsend b85a577ec2 use render plugin to load erb html views 2023-09-14 18:49:18 -07:00
Adam Townsend 81b22d0c4a initial framework for the shortener routes 2023-09-13 13:29:45 -07:00