Sha256: 16c01e661ce31181d784625ef4db18d8253bbdf8646e4452a60a201d1ac7b8aa

Contents?: true

Size: 810 Bytes

Versions: 4

Compression:

Stored size: 810 Bytes

Contents

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

  it('using response from factory bot', function() {
    cy.appFactories([['create', 'post', { title: 'Good bye Mars'} ]]).then((results) => {
      const record = results[0];

      cy.visit(`/posts/${record.id}`);
    });
    cy.contains("Good bye Mars")
  })

  it('using response from multiple factory bot', function() {
    cy.appFactories([
      ['create', 'post', { title: 'My First Post'} ],
      ['create', 'post', { title: 'My Second Post'} ]
    ]).then((results) => {
      cy.visit(`/posts/${results[0].id}`);
      cy.contains("My First Post")

      cy.visit(`/posts/${results[1].id}`);
      cy.contains("My Second Post")
    });
  })
})

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/advance_factory_bot.cy.js
cypress-on-rails-1.16.0 lib/generators/cypress_on_rails/templates/spec/cypress/e2e/rails_examples/advance_factory_bot.cy.js
cypress-on-rails-1.15.1 lib/generators/cypress_on_rails/templates/spec/cypress/e2e/rails_examples/advance_factory_bot.cy.js
cypress-on-rails-1.15.0 lib/generators/cypress_on_rails/templates/spec/cypress/e2e/rails_examples/advance_factory_bot.cy.js