Sha256: 6d4ed01044c4c30dcadcf76676e9394cd112b6ea5396f6b504baafd37246c257

Contents?: true

Size: 737 Bytes

Versions: 7

Compression:

Stored size: 737 Bytes

Contents

require 'spec_helper'

RSpec.feature "controls" do

  let(:user) { User.create(email: "user@domain.com") }
  let!(:product) do
    Audited.audit_class.as_user(user) do
      Product.create(sku: "001", title: "Smartphone", price: "450", active: true, description: "Smartphone ABC")
    end
  end

  before do
  end

  scenario "show audit controls on footer" do
    visit product_path(product)
    expect(page).to have_content "Created at #{I18n.localize(Time.zone.now, format: :short)} by #{user.email}"
    expect(page).to have_content "Show Change Log"
  end

  scenario "show change lng when requested" do
    visit product_path(product)
    click_link "Show Change Log"
    save_page
    expect(page).to have_content("x")
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
audited_views-0.0.7 spec/dummy/spec/features/controls_spec.rb
audited_views-0.0.6 spec/dummy/spec/features/controls_spec.rb
audited_views-0.0.5 spec/dummy/spec/features/controls_spec.rb
audited_views-0.0.4 spec/dummy/spec/features/controls_spec.rb
audited_views-0.0.3 spec/dummy/spec/features/controls_spec.rb
audited_views-0.0.2 spec/dummy/spec/features/controls_spec.rb
audited_views-0.0.1 spec/dummy/spec/features/controls_spec.rb