Sha256: 9e2b5ad89d500201d806d90e6ee33b05487b3f232dc65b087a6d2a1c52d3a1c5

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'
require 'gnawrnip/step_screenshot'

module Gnawrnip
  describe StepScreenshot do
    let(:template) { described_class.new }

    describe '.build' do
      before :each do
        allow(template).to receive(:develop).and_return('')
      end

      let(:example) do
        metadata = { gnawrnip: { screenshot: paths } }
        double('example', metadata: metadata)
      end

      subject { template.build(example) }

      context 'has multiple data' do
        let(:paths) do
          [
            double(path: '/path/to/A.png'),
            double(path: '/path/to/B.png'),
            double(path: '/path/to/C.png')
          ]
        end

        it 'should get image tag and source that base64 encoded' do
          should include '<div class="screenshot animation">'
          should include '<div class="nav">'
        end
      end

      context 'has single data' do
        let(:paths) { [double(path: '/path/to/A.png')] }
        it do
          should include '<div class="screenshot">'
          should_not include '<div class="nav">'
        end
      end

      context 'has no data' do
        let(:paths) { [] }
        it { should eq '' }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gnawrnip-0.5.0 spec/gnawrnip/step_screenshot_spec.rb
gnawrnip-0.4.0 spec/gnawrnip/step_screenshot_spec.rb
gnawrnip-0.3.2 spec/gnawrnip/step_screenshot_spec.rb
gnawrnip-0.3.1 spec/gnawrnip/step_screenshot_spec.rb