add more features for the model section
This commit is contained in:
parent
b2d6a7e001
commit
c7ea5ab532
@ -12,4 +12,4 @@
|
||||
!= t('admin.contents.index.updated_at')
|
||||
= l content.updated_at, :format => :short rescue 'n/a'
|
||||
|
||||
= link_to image_tag('admin/list/icons/trash.png'), admin_content_path(@content_type.slug, content), :class => 'remove', :confirm => t('admin.messages.confirm'), :method => :delete
|
||||
= link_to image_tag('admin/list/icons/trash.png', :alt => t('admin.buttons.delete')), admin_content_path(@content_type.slug, content), :class => 'remove', :confirm => t('admin.messages.confirm'), :method => :delete
|
@ -1,7 +1,7 @@
|
||||
<%
|
||||
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
||||
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
||||
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
|
||||
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
|
||||
%>
|
||||
default: <%= std_opts %> features
|
||||
wip: --tags @wip:3 --wip features
|
||||
|
@ -6,6 +6,7 @@ en:
|
||||
change_password: Update
|
||||
new_item: "+ add"
|
||||
switch_to_site: Go
|
||||
delete: "Delete"
|
||||
|
||||
messages:
|
||||
confirm: Are you sure ?
|
||||
|
@ -16,6 +16,7 @@ fr:
|
||||
change_password: Mettre à jour
|
||||
new_item: "+ ajouter"
|
||||
switch_to_site: Aller
|
||||
delete: "Supprimer"
|
||||
|
||||
messages:
|
||||
confirm: "Êtes-vous sûr(e) ?"
|
||||
|
12
doc/TODO
12
doc/TODO
@ -45,7 +45,16 @@ x cancan: (authors / designers / admin)
|
||||
x theme asset
|
||||
x features / specs
|
||||
x enable rack-cache only for a specific url
|
||||
- check hosting:
|
||||
x heroku
|
||||
- bushi.do
|
||||
- deploy => okay
|
||||
- unable to reach the console
|
||||
- unable to set a new subdomain
|
||||
- convert existing templates (the 2 of the themes section)
|
||||
- liquid tag: Date.today (now), add a test to compare 2 dates
|
||||
- tinyMCE => fullscreen
|
||||
- icon for redirection page in the pages section (back-office)
|
||||
|
||||
=> MERGE
|
||||
|
||||
@ -53,7 +62,6 @@ x enable rack-cache only for a specific url
|
||||
- heroku: unable to upload a new file => okay
|
||||
- import => okay
|
||||
- delete an item => okay
|
||||
- liquid tag: Date.today (now), add a test to compare 2 dates
|
||||
- better ui: increase text field length + refactor error message
|
||||
|
||||
BACKLOG:
|
||||
@ -68,7 +76,7 @@ BACKLOG:
|
||||
- global regions: keyword in editable element (http://www.mongodb.org/display/DOCS/Updating)
|
||||
- cucumber features for admin pages (in progress)
|
||||
(- duostack/doutcloud version)
|
||||
- icon for redirection page in the pages section (back-office)
|
||||
|
||||
- write my first tutorial about locomotive
|
||||
- upgrade warning if new version of locomotive (maybe based on the commit id)
|
||||
- deploying workflow:
|
||||
|
@ -7,10 +7,46 @@ Background:
|
||||
Given I have the site: "test site" set up
|
||||
And I have a custom project model
|
||||
And I am an authenticated user
|
||||
And I have a project entry with "My sexy project" as name and "Lorem ipsum" as description
|
||||
|
||||
Scenario: Adding a new entry
|
||||
Scenario:
|
||||
When I go to the "Projects" model list page
|
||||
Then I should see "My sexy project"
|
||||
|
||||
Scenario: Add a new entry
|
||||
When I go to the "Projects" model edition page
|
||||
And I follow "new item"
|
||||
Then I should see "Projects — new item"
|
||||
When I fill in "Name" with "My other sexy project"
|
||||
And I fill in "Description" with "Lorem ipsum...."
|
||||
And I press "Create"
|
||||
Then I should see "Content was successfully created."
|
||||
|
||||
Scenario: Add an invalid entry
|
||||
When I go to the "Projects" model edition page
|
||||
And I follow "new item"
|
||||
And I fill in "Description" with "Lorem ipsum...."
|
||||
And I press "Create"
|
||||
Then I should not see "Content was successfully created."
|
||||
|
||||
Scenario: Update an existing entry
|
||||
When I go to the "Projects" model list page
|
||||
And I follow "My sexy project"
|
||||
When I fill in "Name" with "My other sexy project (UPDATED)"
|
||||
And I press "Update"
|
||||
Then I should see "Content was successfully updated."
|
||||
When I go to the "Projects" model list page
|
||||
Then I should see "My other sexy project (UPDATED)"
|
||||
|
||||
Scenario: Update an invalid entry
|
||||
When I go to the "Projects" model list page
|
||||
And I follow "My sexy project"
|
||||
When I fill in "Name" with ""
|
||||
And I press "Update"
|
||||
Then I should not see "Content was successfully updated."
|
||||
|
||||
Scenario: Destroy an entry
|
||||
When I go to the "Projects" model list page
|
||||
And I follow image link "Delete"
|
||||
Then I should see "Content was successfully deleted."
|
||||
And I should not see "My sexy project"
|
@ -1,7 +1,12 @@
|
||||
Given /^I have a custom project model/ do
|
||||
site = Site.first
|
||||
@content_type = Factory.build(:content_type, :site => site, :name => 'Projects')
|
||||
@content_type.content_custom_fields.build :label => 'Name', :kind => 'string'
|
||||
@content_type.content_custom_fields.build :label => 'Name', :kind => 'string', :required => true
|
||||
@content_type.content_custom_fields.build :label => 'Description', :kind => 'text'
|
||||
@content_type.save.should be_true
|
||||
end
|
||||
|
||||
Given /^I have a project entry with "(.*)" as name and "(.*)" as description/ do |name, description|
|
||||
@content = @content_type.contents.build :name => name, :description => description
|
||||
@content.save.should be_true
|
||||
end
|
3
features/step_definitions/more_web_steps.rb
Normal file
3
features/step_definitions/more_web_steps.rb
Normal file
@ -0,0 +1,3 @@
|
||||
When /^I follow image link "([^"]*)"$/ do |img_alt|
|
||||
find(:xpath, "//img[@alt = '#{img_alt}']/parent::a").click()
|
||||
end
|
@ -27,6 +27,9 @@ module NavigationHelpers
|
||||
edit_admin_current_site_path
|
||||
when /import page/
|
||||
new_admin_import_path
|
||||
when /the "(.*)" model list page/
|
||||
content_type = Site.first.content_types.where(:name => $1).first
|
||||
admin_contents_path(content_type.slug)
|
||||
when /the "(.*)" model edition page/
|
||||
content_type = Site.first.content_types.where(:name => $1).first
|
||||
edit_admin_content_type_path(content_type)
|
||||
|
Loading…
Reference in New Issue
Block a user