Sha256: 03b4d3409deacad47311d570b21bf40e27fc44a13bbe51367a4f04bf58af11f4

Contents?: true

Size: 984 Bytes

Versions: 23

Compression:

Stored size: 984 Bytes

Contents

require 'spec_helper'

feature "Attachments" do
  background do
    sign_in
  end

  scenario "show message if item is not saved" do
    click_link "Blogs"
    click_link "Create new Blog"
    page.should have_content "First save to enable uploads"
  end

  scenario "show upload form" do
    create(:blog)
    click_link "Blogs"
    click_link "Edit"
    page.should have_selector "#attachments"
  end

  context "with image" do
    background do
      blog = create(:blog)
      @attachment = Brightcontent::Attachment.create!(:asset => Rails.root.join("public/rails.png").open)
      blog.attachments << @attachment
      click_link "Blogs"
      click_link "Edit"
    end

    scenario "shows images" do
      page.should have_selector "#attachment_#{@attachment.id}"
    end

    scenario "delete image" do
      within "#attachment_#{@attachment.id}" do
        click_link "Delete"
      end
      page.should_not have_selector "#attachment_#{@attachment.id}"
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
brightcontent-attachments-2.0.33 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.31 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.30 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.29 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.28 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.27 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.26 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.25 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.24 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.23 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.22 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.21 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.20 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.19 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.18 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.17 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.16 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.15 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.14 spec/features/attachments_spec.rb
brightcontent-attachments-2.0.13 spec/features/attachments_spec.rb