From e50667b3924f6ecab58a13ec15b7a41891a15e95 Mon Sep 17 00:00:00 2001 From: Adam Townsend Date: Tue, 10 Oct 2023 17:29:23 -0700 Subject: [PATCH] split homepage out into homepage and submit feature sets --- features/homepage.feature | 23 ----------------------- features/submit.feature | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 23 deletions(-) create mode 100644 features/submit.feature diff --git a/features/homepage.feature b/features/homepage.feature index 4a96c4a..55bc3b4 100644 --- a/features/homepage.feature +++ b/features/homepage.feature @@ -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" diff --git a/features/submit.feature b/features/submit.feature new file mode 100644 index 0000000..422e082 --- /dev/null +++ b/features/submit.feature @@ -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"