product_spec.rb 638 字节
Newer Older
1
describe QA::Factory::Product do
F
Felipe Artur 已提交
2
  let(:factory) do
3
    Class.new(QA::Factory::Base) do
4 5
      attribute :test do
        'block'
6
      end
7 8

      attribute :no_block
9
    end.new
F
Felipe Artur 已提交
10 11
  end

12
  let(:product) { spy('product') }
13
  let(:product_location) { 'http://product_location' }
14

15
  subject { described_class.new(factory) }
16

17 18
  before do
    factory.web_url = product_location
19 20 21 22 23 24 25
  end

  describe '.visit!' do
    it 'makes it possible to visit fabrication product' do
      allow_any_instance_of(described_class)
        .to receive(:visit).and_return('visited some url')

26
      expect(subject.visit!).to eq 'visited some url'
27 28 29
    end
  end
end