Sha256: aafac2187b7caf0ce89109b52fd7cc4bf15c5eeeca1a15100237e9b38c086056

Contents?: true

Size: 1.47 KB

Versions: 11

Compression:

Stored size: 1.47 KB

Contents

shared_examples 'inserts images' do
  before do
    raise "please set let(:initial_path)" if initial_path.blank?
    ensure_on(initial_path)
  end

  def select_and_insert_image(title, size='medium')
    page.within_frame(dialog_frame_id) do
      within '#existing_image_area_content' do
        find(:xpath, "//img[@alt=\"#{title}\"]").click
        find(:xpath, "//a[@href=\"##{size}\"]").click
        find(:xpath, '//input[@id="submit_button"]').click
      end
    end
  end

  describe 'resize the image' do
    pending
    # it 'inserts an image of the selected size', js: true do
      # click_on('Add Image')
      # select_and_insert_image('Beach','large')
        # sleep 10
        # puts page.html
        # page.within_frame(find(:xpath, '//iframe[contains(@id,"WYMeditor")]')) do
          # expect(page).to have_selector('img[title="Beach"][data-rel*="450x450"]')
      # end
    # end
  end

  context 'when all images are available' do
    pending
    # it 'inserts the image into the page', js: true do
      # click_on('Add Image')
      # select_and_insert_image('Beach')
      # expect(page).to have_image(url)
    # end
  end

  context "when images are filtered by a search" do
    pending

    # before do
      # fill_in "search", :with => "Beach"
      # click_button "Search"
    # end
    # it 'inserts the image into the page', js: true do
      # click_on('Add Image')
      # select_and_insert_image('Beach')
      # expect(page).to have_image(url)
    # end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
refinerycms-images-4.0.3 spec/support/shared_examples/image_inserter.rb
refinerycms-images-4.0.2 spec/support/shared_examples/image_inserter.rb
refinerycms-images-4.0.1 spec/support/shared_examples/image_inserter.rb
refinerycms-images-3.0.6 spec/support/shared_examples/image_inserter.rb
refinerycms-images-4.0.0 spec/support/shared_examples/image_inserter.rb
refinerycms-images-3.0.5 spec/support/shared_examples/image_inserter.rb
refinerycms-images-3.0.4 spec/support/shared_examples/image_inserter.rb
refinerycms-images-3.0.3 spec/support/shared examples/image_inserter.rb
refinerycms-images-3.0.2 spec/support/shared examples/image_inserter.rb
refinerycms-images-3.0.1 spec/support/shared examples/image_inserter.rb
refinerycms-images-3.0.0 spec/support/shared examples/image_inserter.rb