Feature: Track Goals Background: Given an empty tracking database Scenario: No goals When I view "/admin/metry" Then the page should have "#goals" And the page should not have "#goals .goal" Scenario: Create a goal Given I view "/admin/metry" And I follow "New Goal" And I fill in "name" with "Cool" And I fill in "path" with "/goal" And I press "Create" Then I should be on "/admin/metry/goals/1" And I should see "Cool" Scenario: Goal count Given I add a goal named "My Goal" with path "/" And I view "/" When I view "/admin/metry" Then I should see "My Goal: 1 visits" Scenario: Goal Regexp Given I add a goal named "Subpage" with path "/subpage/?" When I view "/subpage" And I view "/subpage/" And I view "/admin/metry" Then I should see "Subpage: 2 visits" Scenario: View Goal Detail Given I add a goal named "Root" with path "/" And I view "/" And I view "/" When I view "/admin/metry" And I follow "Root" Then I should see "Root" And I should see "Path: /" And I should see "Visitor 1" Scenario: Edit a Goal Given I add a goal named "Bogus" with path "/" When I view "/admin/metry" And I follow "Bogus" And I follow "Edit" And I fill in "name" with "Right" And I fill in "path" with "/subpage" And I press "Save" Then I should be on "/admin/metry/goals/1" And I should see "Right" And I should see "Path: /subpage"