Sha256: 54c37a6cec503b802130d461d21edadef226004d6a0368e4e872ff770a8a3b63

Contents?: true

Size: 976 Bytes

Versions: 24

Compression:

Stored size: 976 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 = blog.attachments.create!(:asset => Rails.root.join("public/rails.png").open)
      click_link "Blogs"
      click_link "Edit"
    end

    scenario "shows images" do
      page.should have_selector "[data-attachment-id=\"#{@attachment.id}\"]"
    end

    scenario "delete image" do
      within "[data-attachment-id=\"#{@attachment.id}\"]" do
        click_link "Delete"
      end
      page.should_not have_selector "[data-attachment-id=\"#{@attachment.id}\"]"
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
brightcontent-attachments-2.6.0 spec/features/attachments_spec.rb
brightcontent-attachments-2.5.1 spec/features/attachments_spec.rb
brightcontent-attachments-2.5.0 spec/features/attachments_spec.rb
brightcontent-attachments-2.4.6 spec/features/attachments_spec.rb
brightcontent-attachments-2.4.5 spec/features/attachments_spec.rb
brightcontent-attachments-2.4.4 spec/features/attachments_spec.rb
brightcontent-attachments-2.4.3 spec/features/attachments_spec.rb
brightcontent-attachments-2.4.2 spec/features/attachments_spec.rb
brightcontent-attachments-2.4.1 spec/features/attachments_spec.rb
brightcontent-attachments-2.4.0 spec/features/attachments_spec.rb
brightcontent-attachments-2.3.4 spec/features/attachments_spec.rb
brightcontent-attachments-2.3.3 spec/features/attachments_spec.rb
brightcontent-attachments-2.3.2 spec/features/attachments_spec.rb
brightcontent-attachments-2.3.1 spec/features/attachments_spec.rb
brightcontent-attachments-2.3.0 spec/features/attachments_spec.rb
brightcontent-attachments-2.2.2 spec/features/attachments_spec.rb
brightcontent-attachments-2.2.1 spec/features/attachments_spec.rb
brightcontent-attachments-2.2.0 spec/features/attachments_spec.rb
brightcontent-attachments-2.1.5 spec/features/attachments_spec.rb
brightcontent-attachments-2.1.4 spec/features/attachments_spec.rb