Sha256: 0d7deab77b99d697d32ce89ff1ddeca9ecdf35dd2e0f9cb10eb22b094b0afea6

Contents?: true

Size: 1.3 KB

Versions: 9

Compression:

Stored size: 1.3 KB

Contents

require "rails_helper"

RSpec.feature "Tag management", :type => :feature do
  scenario "user can view tags" do
    create_user_and_login
    tag = create(:tag)

    visit exposition.admin_tags_path

    expect(page).to have_text(tag.label)
  end

  it do
    create_user_and_login
    paginates(factory: :tag, increment: 25, selector: '.tag') do
      visit exposition.admin_tags_path
    end
  end

  scenario "user can create tags " do
    create_user_and_login

    visit exposition.new_admin_tag_path

    fill_in "Label", with: "my tag"
    click_on "Create Tag"

    expect(current_path).to eq(exposition.admin_tags_path)
    expect(page).to have_content("my tag")
  end

  scenario "user can edit tags " do
    create_user_and_login
    tag = create(:tag, label: 'Old Label')

    visit exposition.edit_admin_tag_path(tag)

    fill_in "Label", with: "New Label"
    click_on "Update Tag"

    expect(current_path).to eq(exposition.admin_tags_path)
    expect(page).to have_text("New Label")
  end

  scenario "user can delete tags " do
    create_user_and_login
    tag = create(:tag, label: 'My Label')

    visit exposition.admin_tags_path

    expect(page).to have_text("My Label")

    click_on "Delete"

    expect(current_path).to eq(exposition.admin_tags_path)
    expect(page).to_not have_text("My Label")
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
exposition-0.0.5.7.pre.alpha spec/features/admin/tags_management_spec.rb
exposition-0.0.5.6.pre.alpha spec/features/admin/tags_management_spec.rb
exposition-0.0.5.5.pre.alpha spec/features/admin/tags_management_spec.rb
exposition-0.0.5.4.pre.alpha spec/features/admin/tags_management_spec.rb
exposition-0.0.5.2.pre.alpha spec/features/admin/tags_management_spec.rb
exposition-0.0.5.1.pre.alpha spec/features/admin/tags_management_spec.rb
exposition-0.0.5.pre.alpha spec/features/admin/tags_management_spec.rb
exposition-0.0.4.pre.alpha spec/features/admin/tags_management_spec.rb
exposition-0.0.3.pre.alpha spec/features/admin/tags_management_spec.rb