Sha256: e684b88ee10f13b139cf440290a13360fe1992726223947e4907e474bec72c0c

Contents?: true

Size: 925 Bytes

Versions: 4

Compression:

Stored size: 925 Bytes

Contents

describe('Rails using factory bot examples', function() {
  beforeEach(() => {
    cy.app('clean') // have a look at e2e/app_commands/clean.rb
  })

  it('using single factory bot', function() {
    cy.appFactories([
      ['create', 'post', {title: 'Good bye Mars'} ]
    ])
    cy.visit('/')
    cy.get('table').find('tbody').should(($tbody) => {
      // clean should of removed these from other tests
      expect($tbody).not.to.contain('Hello World')

      expect($tbody).to.contain('Good bye Mars')
    })
  })

  it('using multiple factory bot', function() {
    cy.appFactories([
      ['create_list', 'post', 10],
      ['create', 'post', {title: 'Hello World'} ]
    ])
    cy.visit('/')
    cy.get('table').find('tbody').should(($tbody) => {
      // clean should of removed these from other tests
      expect($tbody).to.contain('Hello World')
      expect($tbody).not.to.contain('Good bye Mars')
    })
  })
})

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cypress-on-rails-1.17.0 lib/generators/cypress_on_rails/templates/spec/cypress/e2e/rails_examples/using_factory_bot.cy.js
cypress-on-rails-1.16.0 lib/generators/cypress_on_rails/templates/spec/cypress/e2e/rails_examples/using_factory_bot.cy.js
cypress-on-rails-1.15.1 lib/generators/cypress_on_rails/templates/spec/cypress/e2e/rails_examples/using_factory_bot.cy.js
cypress-on-rails-1.15.0 lib/generators/cypress_on_rails/templates/spec/cypress/e2e/rails_examples/using_factory_bot.cy.js