Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

verify url field with type text

  • Loading branch information...
commit 2f824dac605f3ea72056e878302065138aac054b 1 parent c4e01f8
@ricardoalmeida ricardoalmeida authored
View
8 app/views/projects/edit.html.haml
@@ -1,3 +1,9 @@
= semantic_form_for @project do |form|
- = form.inputs :name, :url, :email, :branch, :deploy_command, :build_command
+ = form.inputs do
+ = form.input :name
+ = form.input :url, :as => "string"
+ = form.input :email
+ = form.input :branch
+ = form.input :deploy_command
+ = form.input :build_command
= form.buttons
View
8 app/views/projects/new.html.haml
@@ -1,3 +1,9 @@
= semantic_form_for @project do |form|
- = form.inputs :name, :url, :email, :branch, :deploy_command, :build_command
+ = form.inputs do
+ = form.input :name
+ = form.input :url, :as => "string"
+ = form.input :email
+ = form.input :branch
+ = form.input :deploy_command
+ = form.input :build_command
= form.buttons
View
7 features/manage_project.feature
@@ -1,6 +1,5 @@
Feature: Manage projects
- @javascript
Scenario: Register new project
Given I am on the new projects page
Then I should not see /Building/
@@ -12,6 +11,10 @@ Feature: Manage projects
Then a new project should be created
And I should see /Geni/
+ Scenario: Browsers with HTML5 support
+ Given I am on the new projects page
+ Then I should see url field with type text
+
Scenario: Update a project
Given I have a project
And I am on the edit project page
@@ -57,5 +60,5 @@ Feature: Manage projects
And I should receive a link for the feed of the project
When I request '/projects.rss'
Then I should see the name of the project
- When I request '/projects/1.rss'
+ When I request '/projects/1.rss' for created project
Then I should see the name of the project
View
8 features/step_definitions/projects_steps.rb
@@ -10,6 +10,10 @@
visit path
end
+When /^I request '(.*)' for created project$/ do |path|
+ visit path.gsub("1", "#{@project.id}")
+end
+
When /^a new project should be created$/ do
Project.count.should == 1
end
@@ -45,3 +49,7 @@
Then /^I should receive a link for the feed of the project$/ do
page.should have_xpath("//link[@type='application/rss+xml'][@href='/projects/#{@project.name}.rss'][@title='#{@project.name}']")
end
+
+Then /^I should see url field with type text$/ do
+ find(:xpath, '//*[@id="project_url" and @type="text"]').should_not raise_exception(Capybara::ElementNotFound)
+end
Please sign in to comment.
Something went wrong with that request. Please try again.