Sha256: 48cd346d30a318db75c8c63e96d3eb269716d3e85d87e3b421e35eeeee3fe43d

Contents?: true

Size: 1.33 KB

Versions: 14

Compression:

Stored size: 1.33 KB

Contents

require 'rails_helper'

describe 'Associable' do
  let(:user) { create :user, :owner }

  let(:path) { '/u/t/cosas/new' }

  before do
    login_as user
    visit path
  end

  it do
    fill_in 'cosa_nombre', with: 'La cosa'
    select 'Los', from: 'cosa_tipo'
    find('.cosa_categoria_de_cosa input[type=text]').click
    expect(page).to have_text :all, 'Nueva categoría de cosa'
    find('.cosa_categoria_de_cosa .list-group-item').click
    fill_in 'categoria_de_cosa_nombre', with: 'la categoría'
    select 'Completar', from: 'categoria_de_cosa_tipo'
    click_on 'Agregar Categoría de cosa'
    click_on 'Cargar Coso'
    expect(page).to have_text 'La cosa'
  end

  context 'cuando crea desde el nested' do
    let!(:categ) { create :categoria_de_cosa }
    let(:path) { "/u/t/categoria_de_cosas/#{categ.hashid}/cosas/new" }

    it do
      input = find_by_id('cosa_categoria_de_cosa')
      expect(input).to be_disabled
    end
  end

  context 'cuando edita desde el nested' do
    let!(:categ) { create :categoria_de_cosa }
    let!(:cosa) { create :cosa, categoria_de_cosa: categ }
    let(:path) { "/u/t/categoria_de_cosas/#{categ.hashid}/cosas/#{cosa.id}/edit" }

    it do
      ele = find_by_id('cosa_categoria_de_cosa_id', visible: :all)
      input = ele.sibling('input[type=text]')
      expect(input).not_to be_disabled
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
pg_rails-7.6.23 pg_associable/spec/system/associable_spec.rb
pg_rails-7.6.22 pg_associable/spec/system/associable_spec.rb
pg_rails-7.6.22.pre.3 pg_associable/spec/system/associable_spec.rb
pg_rails-7.6.22.pre.2 pg_associable/spec/system/associable_spec.rb
pg_rails-7.6.22.pre.1 pg_associable/spec/system/associable_spec.rb
pg_rails-7.6.21 pg_associable/spec/system/associable_spec.rb
pg_rails-7.6.21.pre.11 pg_associable/spec/system/associable_spec.rb
pg_rails-7.6.21.pre.10 pg_associable/spec/system/associable_spec.rb
pg_rails-7.6.21.pre.9 pg_associable/spec/system/associable_spec.rb
pg_rails-7.6.21.pre.8 pg_associable/spec/system/associable_spec.rb
pg_rails-7.6.21.pre.7 pg_associable/spec/system/associable_spec.rb
pg_rails-7.6.21.pre.6 pg_associable/spec/system/associable_spec.rb
pg_rails-7.6.21.pre.5 pg_associable/spec/system/associable_spec.rb
pg_rails-7.6.21.pre.4 pg_associable/spec/system/associable_spec.rb