Sha256: fdd109dc04a0579d067738fe29b53e68f8a99563de4cd1d0680331e9a062adac

Contents?: true

Size: 1.84 KB

Versions: 2

Compression:

Stored size: 1.84 KB

Contents

require 'spec_helper'

feature "ResourceOperations", :type => :feature do
  scenario "view feature index" do
    feature_login
    FactoryGirl.create(:invoice, invoice_number: '123312')
    click_link 'Invoices'
    expect(page).to have_selector('table tbody tr td', text: '123312')
  end
  scenario "Create new resource item" do
    feature_login
    click_link 'Customers'
    click_link 'New Customer'
    fill_in 'First name', with: 'John'
    fill_in 'Last name', with: 'Doe'
    fill_in 'Email', with: 'john@doe.com'
    fill_in 'Phone number', with: '4025557878'
    select 'Yes', from: 'Active'
    click_button 'Create Customer'
    expect(page).to have_selector('.kv-value', text: 'John Doe')
  end
  scenario "Edit resource item" do
    feature_login
    customer = FactoryGirl.create(:customer)
    visit app_kit.customer_path(customer)
    click_link 'edit details'
    fill_in 'First name', with: 'TestFirstName'
    fill_in 'Last name', with: 'TestLastName'
    click_button 'Update Customer'
    expect(page).to have_selector('.kv-value',text: 'TestFirstName TestLastName')
  end
  scenario "create nested resource" do
    customer = FactoryGirl.create(:customer)
    feature_login
    visit app_kit.customer_path(customer)
    click_link 'Create'
    select 'No', from: 'Paid'
    select 'No', from: 'Published'
    click_button 'Create Invoice'
    expect(page).to have_selector('.kv-value',
                                  text: Invoice.last.invoice_number)
    expect(page).to have_selector(".kv-value a", text: customer.to_s)
  end
  scenario "view nested resource" do
    feature_login
    customer = FactoryGirl.create(:customer)
    invoice = FactoryGirl.create(:invoice, customer: customer)
    visit app_kit.customer_path(customer)
    expect(page).to have_selector('table tbody tr td',
                                  text: invoice.invoice_number)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
app_kit-0.0.2 spec/features/app_kit/app_kit_resource_operations_spec.rb
app_kit-0.0.1 spec/features/app_kit/app_kit_resource_operations_spec.rb