Compare commits
No commits in common. "a1ea2a09ec9cc5e95e25759e7eb997a7113aebb2" and "94026bdad24fb93d32550ce9f2a0f57e565dc499" have entirely different histories.
a1ea2a09ec
...
94026bdad2
1
app.rb
1
app.rb
|
|
@ -19,7 +19,6 @@ class App < Roda
|
|||
|
||||
r.post "create" do
|
||||
url = r.params['url']
|
||||
if url.empty? then r.redirect '/' end
|
||||
if nil == links.filter(:url => url).first
|
||||
code = SecureRandom.urlsafe_base64 4
|
||||
links.insert(url: url, code: code)
|
||||
|
|
|
|||
|
|
@ -5,13 +5,7 @@ Feature: Homepage
|
|||
Loading the homepage is the initial starting point for this tool
|
||||
|
||||
Scenario: Homepage Loads with a form
|
||||
Given I visit the '/' page
|
||||
Given I visit the homepage
|
||||
Then I should see text "URL Shortener"
|
||||
And I should see a form field "url"
|
||||
And I should see a "Submit" button
|
||||
|
||||
Scenario: Submitting the form without entering a URL
|
||||
Given I visit the '/' page
|
||||
When I click the "Submit" button
|
||||
Then I should be on "/" page
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
# GIVEN
|
||||
|
||||
Given('I visit the {string} page') do |string|
|
||||
visit string
|
||||
Given('I visit the homepage') do
|
||||
visit '/'
|
||||
end
|
||||
|
||||
# WHEN
|
||||
|
||||
When('I click the {string} button') do |string|
|
||||
click_button {string}
|
||||
end
|
||||
|
||||
|
||||
# THEN
|
||||
|
||||
|
|
@ -23,7 +21,3 @@ end
|
|||
Then('I should see a {string} button') do |string|
|
||||
page.should have_button string
|
||||
end
|
||||
|
||||
Then('I should be on {string} page') do |string|
|
||||
page.should have_current_path string
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue