Sha256: abca43faec2b8879f929078bf5ad171a2e570f40518dcbeeeae87845da543c40

Contents?: true

Size: 1.51 KB

Versions: 11

Compression:

Stored size: 1.51 KB

Contents

require 'spec_helper'

describe "Picture Library", type: :feature, js: true do

  before do
    authorize_as_admin
  end

  describe "Tagging" do

    before do
      picture = FactoryGirl.create(:picture, tag_list: 'tag1', name: 'TaggedWith1')
      picture = FactoryGirl.create(:picture, tag_list: 'tag2', name: 'TaggedWith2')
    end

    it "it should be possible to filter tags by clicking on its name in the tag list" do
      visit '/admin/pictures'
      click_on 'tag1 (1)'
      expect(page).to have_content 'TaggedWith1'
      expect(page).not_to have_content 'TaggedWith2'
    end

    it "it should be possible to undo tag filtering by clicking on an active tag name" do
      visit '/admin/pictures'
      click_on 'tag1 (1)'
      expect(page).not_to have_content 'TaggedWith2'
      click_on 'tag1 (1)'
      expect(page).to have_content 'TaggedWith2'
    end

    it "it should be possible to tighten the tag scope by clicking on another tag name" do
      visit '/admin/pictures'
      click_on 'tag1 (1)'
      click_on 'tag2 (1)'
      expect(page).to have_content "You don't have any images in your archive"
    end

  end

  describe "Filter by tag" do

    before do
      FactoryGirl.create(:picture, tag_list: 'bla')
    end

    it "should list all applied tags" do
      visit '/admin/pictures'
      expect(page).to have_content 'bla'
    end

    it "should be possible to filter pictures by tag" do
      visit '/admin/pictures'
      click_on 'bla (1)'
      expect(page).to have_content 'bla'
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
alchemy_cms-3.1.1 spec/features/admin/picture_library_integration_spec.rb
alchemy_cms-3.1.0 spec/features/admin/picture_library_integration_spec.rb
alchemy_cms-3.1.0.rc3 spec/features/admin/picture_library_integration_spec.rb
alchemy_cms-3.1.0.rc2 spec/features/admin/picture_library_integration_spec.rb
alchemy_cms-3.1.0.rc1 spec/features/admin/picture_library_integration_spec.rb
alchemy_cms-3.1.0.beta6 spec/features/admin/picture_library_integration_spec.rb
alchemy_cms-3.1.0.beta5 spec/features/admin/picture_library_integration_spec.rb
alchemy_cms-3.1.0.beta4 spec/features/admin/picture_library_integration_spec.rb
alchemy_cms-3.1.0.beta3 spec/features/admin/picture_library_integration_spec.rb
alchemy_cms-3.1.0.beta2 spec/features/admin/picture_library_integration_spec.rb
alchemy_cms-3.1.0.beta1 spec/features/admin/picture_library_integration_spec.rb