Sha256: 6d7fbeb072464e9ffe77e703c162abd5358f15775c69350620f53af89c730aca

Contents?: true

Size: 1.96 KB

Versions: 18

Compression:

Stored size: 1.96 KB

Contents

Given /^I am using the asset library$/ do
  visit noodall_admin_assets_path
end

When /^I upload a file$/ do
  click_link "Upload"
  fill_in "Title", :with => "A loverly asset"
  attach_file("File", "#{Rails.root}/spec/files/beef.png")
end

When /^enter tags$/ do
  fill_in "Tags", :with => "you, me, things, stuff"
  fill_in "Description", :with => "Some nice info"
  click_button "Create"
end

Then /^it should appear in the asset library$/ do
  page.should_not have_content('Errors')
  page.should have_content('A loverly asset')
end

Given /^files have been uploaded to the asset library$/ do
  20.times { Factory(:asset) }
  20.times { Factory(:document_asset) }
  20.times { Factory(:video_asset) }

  20.times { Factory(:asset, :title => "Tagged Asset", :tags => ['RAC','lorem','dolar']) }

end

Then /^I should be able to browse assets by content type$/ do
  within(:css, "ul.choices") { click_link "Images" }
  page.should_not have_content('Document asset')
  page.should_not have_content('Video asset')
  within(:css, "ul.choices") { click_link "Documents" }
  page.should_not have_content('Image asset')
  page.should_not have_content('Video asset')
  if Asset.video_extensions.any?
    within(:css, "ul.choices") { click_link "Videos" }
    page.should_not have_content('Document asset')
    page.should_not have_content('Image asset')
  end
end

Then /^I should be able to browse assets by tags$/ do
  within(:css, "ul.choices") { click_link "Images" }
  within(:css, "div#tags") { click_link "RAC" }
  page.should_not have_content('Image asset')
end

When /^I click the editor "([^"]*)" button$/ do |button_name|
  within('.mceToolbar') do
    click_link button_name
  end
end

When /^I click "([^"]*)" on an Asset$/ do |button_name|
  within('#browser-list ul li:first') do
    click_link button_name
  end
end

Then /^the "([^"]*)" asset should appear in the content editor$/ do |asset_type|
  within_frame('node_body_ifr') do
    page.should have_css("#tinymce img[src^='/media/']")
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
noodall-ui-0.0.22 features/step_definitions/asset_steps.rb
noodall-ui-0.0.21 features/step_definitions/asset_steps.rb
noodall-ui-0.0.20 features/step_definitions/asset_steps.rb
noodall-ui-0.0.19 features/step_definitions/asset_steps.rb
noodall-ui-0.0.18 features/step_definitions/asset_steps.rb
noodall-ui-0.0.17 features/step_definitions/asset_steps.rb
noodall-ui-0.0.16 features/step_definitions/asset_steps.rb
noodall-ui-0.0.15 features/step_definitions/asset_steps.rb
noodall-ui-0.0.14 features/step_definitions/asset_steps.rb
noodall-ui-0.0.13 features/step_definitions/asset_steps.rb
noodall-ui-0.0.12 features/step_definitions/asset_steps.rb
noodall-ui-0.0.11 features/step_definitions/asset_steps.rb
noodall-ui-0.0.10 features/step_definitions/asset_steps.rb
noodall-ui-0.0.9 features/step_definitions/asset_steps.rb
noodall-ui-0.0.8 features/step_definitions/asset_steps.rb
noodall-ui-0.0.7 features/step_definitions/asset_steps.rb
noodall-ui-0.0.6 features/step_definitions/asset_steps.rb
noodall-ui-0.0.5 features/step_definitions/asset_steps.rb