Skip to content
This repository has been archived by the owner on Jan 30, 2018. It is now read-only.

Commit

Permalink
Added features for moving folders and files
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur Szwed committed Sep 2, 2011
1 parent 1ad9621 commit 52a3fa1
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
41 changes: 41 additions & 0 deletions features/folder_move.feature
@@ -0,0 +1,41 @@
@uploads @javascript @moveable
Feature: Moving a folder

Background:
Given a confirmed user exists with login: "mislav", first_name: "Mislav", last_name: "Marohnić"
And I am logged in as @mislav
And I am currently in the project ruby_rockstars
Given a current project has nested folders
| name |
| Director |
| Tarantino |
| Pulp Fiction |
| Mia Wallace |

Scenario: Mislav moves a file
When I go to the uploads page of the "Ruby Rockstars" project
And I enter "Director" folder
And I enter "Tarantino" folder
And I enter "Pulp Fiction" folder
And I click upload list item for "Mia Wallace" folder
And I follow "Move to another folder"
And I select "Move to parent folder" from target folders list
And I press "Move"
Then I should not see "Mia Wallace" within ".upload"
When I follow "Parent folder"
Then I should see "Mia Wallace" within ".upload"
When I click upload list item for "Mia Wallace" folder
And I follow "Move to another folder"
And I select "Move to parent folder" from target folders list
And I press "Move"
Then I should not see "Mia Wallace" within ".upload"
When I follow "Parent folder"
Then I should see "Mia Wallace" within ".upload"
When I click upload list item for "Mia Wallace" folder
And I follow "Move to another folder"
And I select "Tarantino" from target folders list
And I press "Move"
Then I should not see "Mia Wallace" within ".upload"
When I enter "Tarantino" folder
Then I should see "Mia Wallace" within ".upload"

4 changes: 4 additions & 0 deletions features/step_definitions/upload_steps.rb
Expand Up @@ -30,3 +30,7 @@
When /^I click upload list item for "([^\"]*)" file$/ do |filename|
page.find(:xpath, "//div[@class = 'header' and .//a[contains(text(),'#{filename}')]]").click
end

When /^I select "([^\"]*)" from target folders list$/ do |folder_name|
And %(I select "#{folder_name}" from "target_folder_id")
end
31 changes: 31 additions & 0 deletions features/upload_move.feature
@@ -0,0 +1,31 @@
@uploads @javascript @moveable
Feature: Moving a file upload

Background:
Given a confirmed user exists with login: "mislav", first_name: "Mislav", last_name: "Marohnić"
And I am logged in as @mislav
And I am currently in the project ruby_rockstars
Given a current project has nested folders
| name |
| Director |
| Tarantino |
| Pulp Fiction |
| Mia Wallace |
And "tb-space.jpg" has been uploaded to the "Ruby Rockstars" project

Scenario: Mislav moves a file
When I go to the uploads page of the "Ruby Rockstars" project
And I click upload list item for "tb-space.jpg" file
And I follow "Move to another folder"
And I select "Director" from target folders list
And I press "Move"
Then I should not see "tb-space.jpg"
When I enter "Director" folder
Then I should see "tb-space.jpg" within ".file_upload"
When I click upload list item for "tb-space.jpg" file
And I follow "Move to another folder"
And I select "Move to parent folder" from target folders list
And I press "Move"
Then I should not see "tb-space.jpg"
When I follow "Parent folder"
Then I should see "tb-space.jpg" within ".file_upload"

0 comments on commit 52a3fa1

Please sign in to comment.