Sha256: eab5b4ba08fdbbd3539bea2ac616818624cc3c91147932d7723713552818e9e9

Contents?: true

Size: 1.97 KB

Versions: 17

Compression:

Stored size: 1.97 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|
  sleep 3
  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

17 entries across 17 versions & 1 rubygems

Version Path
noodall-ui-0.1.17 features/step_definitions/asset_steps.rb
noodall-ui-0.1.16 features/step_definitions/asset_steps.rb
noodall-ui-0.1.15 features/step_definitions/asset_steps.rb
noodall-ui-0.1.14 features/step_definitions/asset_steps.rb
noodall-ui-0.1.13 features/step_definitions/asset_steps.rb
noodall-ui-0.1.12 features/step_definitions/asset_steps.rb
noodall-ui-0.1.11 features/step_definitions/asset_steps.rb
noodall-ui-0.1.10 features/step_definitions/asset_steps.rb
noodall-ui-0.1.9 features/step_definitions/asset_steps.rb
noodall-ui-0.1.8 features/step_definitions/asset_steps.rb
noodall-ui-0.1.6 features/step_definitions/asset_steps.rb
noodall-ui-0.1.5 features/step_definitions/asset_steps.rb
noodall-ui-0.1.4 features/step_definitions/asset_steps.rb
noodall-ui-0.1.3 features/step_definitions/asset_steps.rb
noodall-ui-0.1.2 features/step_definitions/asset_steps.rb
noodall-ui-0.1.1 features/step_definitions/asset_steps.rb
noodall-ui-0.1.0 features/step_definitions/asset_steps.rb