Skip to content

Commit

Permalink
Merge remote branch 'ugisozols/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Aug 4, 2010
2 parents 41f6029 + 438bb72 commit 8647011
Show file tree
Hide file tree
Showing 14 changed files with 111 additions and 75 deletions.
44 changes: 28 additions & 16 deletions features/refinery/dashboard.feature
Expand Up @@ -6,14 +6,38 @@ Feature: Dashboard

Background:
Given I am a logged in refinery user

Scenario: Translation options available
When I go to the Dashboard

Scenario: Add New Page Button
When I follow "Add a new page"
Then I should be on the new page form
When I fill in "Title" with "Page test from Dashboard"
And I press "Save"
Then I should be on the dashboard
And I should see "'Page test from Dashboard' was successfully created."
And I should see "Page test from dashboard page was created"

Scenario: Update a Page Button
When I follow "Update a page"
Then I should be on the list of pages

Scenario: Upload a File Button
When I follow "Upload a file"
Then I should be on the new file form

Scenario: Upload an Image Button
When I follow "Upload an image"
Then I should be on the new image form

Scenario: See Home Page Button
When I follow "See home page"
Then I should be on the home page

Scenario: Translation options available
Then I should see "English Change Language"

Scenario: Change Language to Slovenian and back to English
When I go to the dashboard
And I follow "English Change Language"
When I follow "English Change Language"
And I follow "Slovenian"
Then I should be on the dashboard
And I should see "Slovenian Spremeni Jezik"
Expand All @@ -24,15 +48,3 @@ Feature: Dashboard
Then I should be on the dashboard
And I should see "Switch to your website"
And I should not see "Spremeni Jezik"

Scenario: Upload an Image Button

Scenario: Add New Page Button
When I go to the dashboard
And I follow "Add a new page"
Then I should be on the new page form
When I fill in "Title" with "Page test from Dashboard"
And I press "Save"
Then I should be on the dashboard
And I should see "'Page test from Dashboard' was successfully created."
And I should see "Page test from dashboard page was created"
33 changes: 14 additions & 19 deletions features/refinery/manage_files.feature
Expand Up @@ -3,43 +3,38 @@ Feature: Manage Files
In order to control the content on my website
As an administrator
I want to create and manage files

Background:
Given I am a logged in refinery user

Scenario: Create Valid File
Given I have no files
When I go to the list of files
And I follow "Upload New File"
When I attach the file at "features/uploads/refinery_is_awesome.txt"
And I attach the file at "features/uploads/refinery_is_awesome.txt"
And I press "Save"
Then the file "refinery_is_awesome.txt" should have uploaded successfully
And I should have 1 file

Scenario: Edit Existing File
Given I have no files
When I upload the file at "features/uploads/refinery_is_awesome.txt"
Then I go to the list of files
Given I have test file titled "refinery_is_awesome.txt"
When I go to the list of files
And I follow "Edit this file"
And I attach the file at "features/uploads/beach.jpeg"
And I press "Save"
Then the file "beach.jpeg" should have uploaded successfully
And I should have 1 file

Scenario: Download Existing File
Given I have no files
When I upload the file at "features/uploads/refinery_is_awesome.txt"
Then I go to the list of files
And I go to the list of files
And I follow "Download this file"
Then I should see "http://www.refineryhq.com/"

Scenario: Files Delete
#The 'follow "Remove this file forever" line is failing -- needs fixed.
#Given I have no files
#When I upload the file at "features/uploads/refinery_is_awesome.txt"
#Then I go to the list of files
#And I follow "Remove this file forever"
#And I press "OK"
#Then I should see "Flash message here.. not in place?"
#And I should have 0 files

Given I have test file titled "refinery_is_awesome.txt"
When I go to the list of files
And I follow "Remove this file forever"
Then I should see "'Refinery Is Awesome' was successfully destroyed."
And I should have 0 files
39 changes: 13 additions & 26 deletions features/refinery/manage_images.feature
Expand Up @@ -3,15 +3,15 @@ Feature: Manage Images
In order to control the content on my website
As an administrator
I want to create and manage images

Background:
Given I am a logged in refinery user

Scenario: Create Valid Image
Given I have no images
When I go to the list of images
And I follow "Create New Image"
When I attach the image at "features/uploads/beach.jpeg"
And I attach the image at "features/uploads/beach.jpeg"
And I press "Save"
Then the image "beach.jpeg" should have uploaded successfully
And I should have the correct default number of images
Expand All @@ -21,41 +21,28 @@ Feature: Manage Images
And the image should have content_type "image/jpeg"
#This line handles properly if you have any plugins installed. Ie: Portfolio will generate two additional thumbs.
And the image should have all default thumbnail generations

Scenario: Create Invalid Image (format)
Given I have no images
When I go to the list of images
And I follow "Create New Image"
When I attach the image at "features/uploads/beach.INVALID"
And I attach the image at "features/uploads/beach.INVALID"
And I press "Save"
Then I should see "Your image must be either a JPG, PNG or GIF"
And I should have 0 images



Scenario: Edit Existing Image
Given I have no images
Given I have test image titled "beach.jpg"
When I go to the list of images
And I follow "Create New Image"
When I attach the image at "features/uploads/beach.jpeg"
And I press "Save"
Then the image "beach.jpeg" should have uploaded successfully
Then I go to the list of images
And I follow "Edit this image"
And I attach the image at "features/uploads/id-rather-be-here.jpg"
And I press "Save"
#Note: The following line is a workaround for the flash. It isn't working, so this catches the created image's name='' attribute.
Then I should see "Id Rather Be Here"
Then I should see "'Id Rather Be Here' was successfully updated."
And I should have the correct default number of images

Scenario: Delete Image
Given I have no images
Given I have test image titled "beach.jpg"
When I go to the list of images
And I follow "Create New Image"
When I attach the image at "features/uploads/beach.jpeg"
And I press "Save"
Then the image "beach.jpeg" should have uploaded successfully
Then I go to the list of images
#Delete functionality doesn't test properly, yet.
#And I follow "Remove this image forever"
#And I press "Ok"
#Then I should have 0 images
And I follow "Remove this image forever"
Then I should see "'Beach' was successfully destroyed. "
And I should have 0 images
14 changes: 6 additions & 8 deletions features/refinery/manage_inquiries.feature
Expand Up @@ -46,11 +46,9 @@ Feature: Manage Inquiries
And I should see "Back to all Inquiries"
And I should see "Remove this inquiry forever"

# not worth it unless someone can confirm javascript confirmations??
#Scenario: Inquiries Delete
# When I go to the list of inquiries
# And I follow "Read the inquiry"
# And I follow "Remove this inquiry forever"
# And I press "OK"
# Then I should see "'David Jones' was successfully destroyed."
# And I should have 0 inquiries
Scenario: Inquiries Delete
When I go to the list of inquiries
And I follow "Read the inquiry"
And I follow "Remove this inquiry forever"
Then I should see "'David Jones' was successfully destroyed."
And I should have 0 inquiries
6 changes: 6 additions & 0 deletions features/refinery/manage_pages.feature
Expand Up @@ -37,3 +37,9 @@ Feature: Manage Pages
And I press "Save"
Then I should have 3 pages
And I should have a page at /about--2

Scenario: Delete Page
Given I have test page titled "test"
When I go to the list of pages
And I follow "Delete this page"
Then I should see "'test' was successfully destroyed. "
26 changes: 26 additions & 0 deletions features/refinery/manage_users.feature
Expand Up @@ -27,3 +27,29 @@ Feature: Manage Users
And I am a logged in refinery user
When I go to the list of users
Then I should see "resolve"

Scenario: Create User
Given I have a user named "resolve"
And I am a logged in refinery user
When I go to the list of users
And I follow "Create New User"
And I fill in "Login" with "cucumber"
And I fill in "Email" with "green@cucumber.com"
And I fill in "Password" with "greenandjuicy"
And I fill in "Password confirmation" with "greenandjuicy"
And I press "Save"
Then I should be on the list of users
And I should see "cucumber was successfully created."
And I should see "cucumber (green@cucumber.com)"

Scenario: Edit User
Given I have a user named "resolve"
And I am a logged in refinery user
When I go to the list of users
And I follow "Edit this user"
And I fill in "Login" with "cucumber"
And I fill in "Email" with "green@cucumber.com"
And I press "Save"
Then I should be on the list of users
And I should see "cucumber was successfully updated."
And I should see "cucumber (green@cucumber.com)"
2 changes: 1 addition & 1 deletion features/refinery/site_bar.feature
Expand Up @@ -21,4 +21,4 @@ Feature: Site Bar
Given A Refinery user exists
And I am a logged in customer
When I go to the home page
Then I should not see "Switch to your website editor"
Then I should not see "Switch to your website editor"
6 changes: 6 additions & 0 deletions features/support/paths.rb
Expand Up @@ -23,9 +23,15 @@ def path_to(page_name)
when /the list of files/
admin_resources_path

when /the new file form/
new_admin_resource_path

when /the list of images/
admin_images_path

when /the new image form/
new_admin_image_path

when /the contact page/
new_inquiry_path

Expand Down
Expand Up @@ -11,7 +11,8 @@
<%= link_to refinery_icon_tag('delete.png'), admin_image_path(image),
:class => "cancel confirm-delete",
:title => t('admin.images.image.delete.title'),
:'data-confirm' => t('admin.images.image.delete.message', :title => image.filename) %>
:'data-confirm' => t('admin.images.image.delete.message', :title => image.filename),
:'data-method' => "delete" %>
</span>
</li>
<% end -%>
Expand Down
Expand Up @@ -12,7 +12,8 @@
<%= link_to refinery_icon_tag('delete.png'), admin_image_path(list_view_image),
:class => "cancel confirm-delete",
:title => t('admin.images.image.delete.title'),
:'data-confirm' => t('admin.images.image.delete.message', :title => list_view_image.filename) %>
:'data-confirm' => t('admin.images.image.delete.message', :title => list_view_image.filename),
:'data-method' => "delete" %>
</span>
</li>
<% end %>
Expand Up @@ -7,7 +7,8 @@
<%= link_to refinery_icon_tag('delete.png'), admin_inquiry_url(inquiry),
:class => "cancel confirm-delete",
:title => t('.title'),
:'data-confirm' => t('.remove_inquiry', :name => inquiry.name) -%>
:'data-confirm' => t('.remove_inquiry', :name => inquiry.name),
:'data-method' => "delete" -%>
<%= link_to refinery_icon_tag('zoom.png'), admin_inquiry_url(inquiry),
:title => t('.read_inquiry') -%>
Expand Down
Expand Up @@ -16,7 +16,8 @@
<li>
<%= link_to t('.title'), admin_inquiry_url(@inquiry), :class => 'delete_icon no-tooltip confirm-delete',
:title => t('.title'),
:'data-confirm' => t('admin.inquiries.inquiry.remove_inquiry', :name => @inquiry.name) %>
:'data-confirm' => t('admin.inquiries.inquiry.remove_inquiry', :name => @inquiry.name),
:'data-method' => "delete" %>
</li>
</ul>
</div>
Expand Down
1 change: 1 addition & 0 deletions vendor/plugins/pages/app/views/admin/pages/_page.html.erb
Expand Up @@ -20,6 +20,7 @@
:title => t('.edit_this_page') %>
<%= link_to refinery_icon_tag('delete.png'), admin_page_url(page),
:class => "cancel confirm-delete",
:'data-method' => "delete",
:title => t('.confirm_delete_page_title') if page.deletable? %>
</span>
</div>
Expand Down
Expand Up @@ -11,6 +11,7 @@
<%= link_to refinery_icon_tag('delete.png'), admin_resource_path(resource),
:class => "cancel confirm-delete",
:title => t('.delete.title'),
:'data-confirm' => t('.delete.message', :title => resource.filename) %>
:'data-confirm' => t('.delete.message', :title => resource.filename),
:'data-method' => "delete" %>
</span>
</li>

0 comments on commit 8647011

Please sign in to comment.