split homepage out into homepage and submit feature sets

pull/21/head
Adam Townsend 2023-10-10 17:29:23 -07:00
parent d4db64f404
commit e50667b392
2 changed files with 28 additions and 23 deletions

View File

@ -10,26 +10,3 @@ Feature: Homepage
And I should see the message "Enter a URL"
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
And I should see the message "Please enter a valid URL"
@db-test
Scenario: Submitting the form with a correct URL
Given I visit the "/" page
When I type "http://google.com" in the "url" field
And I click the "Submit" button
Then I should be on "/create" page
And I should see the message "Link created"
@db-test
Scenario: Submitting the form with an existing URL
Given I visit the "/" page
And A link already exists with the url "http://google.com"
When I type "http://google.com" in the "url" field
And I click the "Submit" button
Then I should be on "/create" page
And I should see the message "Link exists"

View File

@ -0,0 +1,28 @@
# features/submit.feature
Feature: Submit
Submitting URL's on the homepage
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
And I should see the message "Please enter a valid URL"
@db-test
Scenario: Submitting the form with a correct URL
Given I visit the "/" page
When I type "http://google.com" in the "url" field
And I click the "Submit" button
Then I should be on "/create" page
And I should see the message "Link created"
@db-test
Scenario: Submitting the form with an existing URL
Given I visit the "/" page
And A link already exists with the url "http://google.com"
When I type "http://google.com" in the "url" field
And I click the "Submit" button
Then I should be on "/create" page
And I should see the message "Link exists"