Sha256: 802ee2dc4cfee01380ca04f951bf84fd530f36aa69c639b5522acea2db024a57

Contents?: true

Size: 1.29 KB

Versions: 12

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'

describe "Picture Library", :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 '/alchemy/admin/pictures'
      click_on 'tag1 (1)'
      page.should have_content 'TaggedWith1'
      page.should_not have_content 'TaggedWith2'
    end

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

  end

  describe "Filter by tag" do

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

    it "should list all applied tags" do
      visit '/alchemy/admin/pictures'
      page.should have_content 'bla'
    end

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

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
alchemy_cms-2.3.2 spec/integration/admin/picture_library_integration_spec.rb
alchemy_cms-2.4.1 spec/integration/admin/picture_library_integration_spec.rb
alchemy_cms-2.5.0.b5 spec/integration/admin/picture_library_integration_spec.rb
alchemy_cms-2.5.0.b2 spec/integration/admin/picture_library_integration_spec.rb
alchemy_cms-2.4.0 spec/integration/admin/picture_library_integration_spec.rb
alchemy_cms-2.4.rc4 spec/integration/admin/picture_library_integration_spec.rb
alchemy_cms-2.4.rc2 spec/integration/admin/picture_library_integration_spec.rb
alchemy_cms-2.4.rc1 spec/integration/admin/picture_library_integration_spec.rb
alchemy_cms-2.3.1 spec/integration/admin/picture_library_integration_spec.rb
alchemy_cms-2.4.beta2 spec/integration/admin/picture_library_integration_spec.rb
alchemy_cms-2.3.0 spec/integration/admin/picture_library_integration_spec.rb
alchemy_cms-2.3.rc5 spec/integration/admin/picture_library_integration_spec.rb