Sha256: 6e9e0a80291e153725f8e2c8f88796d08d3c2096de596d5079da1a366bc6d71b
Contents?: true
Size: 833 Bytes
Versions: 22
Compression:
Stored size: 833 Bytes
Contents
require 'cypress_on_rails/simple_rails_factory' RSpec.describe CypressOnRails::SimpleRailsFactory do subject { CypressOnRails::SimpleRailsFactory } class AppRecord def self.create!(*) end end before { allow(AppRecord).to receive(:create!) } it do subject.create('AppRecord', { my_args: 'Hello World' }) expect(AppRecord).to have_received(:create!).with( { my_args: 'Hello World' } ) end it do subject.create('AppRecord', 'trait', { my_args: 'Hello World' }) expect(AppRecord).to have_received(:create!).with( 'trait', { my_args: 'Hello World' } ) end it do subject.create('AppRecord') expect(AppRecord).to have_received(:create!).with( { } ) end it do expect{ subject.create('UnknownRecord', { my_args: 'Hello World' }) }. to raise_error(NameError) end end
Version data entries
22 entries across 22 versions & 1 rubygems