Sha256: 573982d662c62986e5bb040d078c929f5f623743804253cc695f7682c8ed419b

Contents?: true

Size: 1.23 KB

Versions: 1

Compression:

Stored size: 1.23 KB

Contents

require "spec_helper"

describe "manage photo items", :type => :feature do
  refinery_login_with_devise :authentication_devise_refinery_superuser


  describe "edit/update" do
    before do
      FactoryGirl.create(:album_with_photos, :title => "Album name")
    end

    it "updates photo" do
      visit refinery.photo_gallery_admin_albums_path

      expect(page).to have_content("Album name")

      click_link "Edit photos in album"

      fill_in "photos_photo_5_title", :with => "Updated title 5"
      fill_in "photos_photo_4_title", :with => "Updated title 4"
      fill_in "photos_photo_3_title", :with => "Updated title 3"
      fill_in "photos_photo_2_title", :with => "Updated title 2"
      fill_in "photos_photo_1_title", :with => "Updated title 1"
      click_button "Save"

      expect(page).to have_content("Updated photos")
    end
  end

  describe "destroy" do
    before do
      FactoryGirl.create(:album_with_photos, :title => "Album name")
    end

    it "removes photo" do
      visit refinery.photo_gallery_admin_albums_path

      expect(page).to have_content("Album name")

      click_link "Edit photos in album"

      first(:link, "Remove").click

      expect(Refinery::PhotoGallery::Photo.count).to eq(4)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
refinerycms-photo-gallery-0.2.0 spec/features/manage_photos_spec.rb