Sha256: 71b20f56bce249ebd0758476671986c0e1aac5ee748238a8df4f5887864a4951

Contents?: true

Size: 935 Bytes

Versions: 7

Compression:

Stored size: 935 Bytes

Contents

require 'spec_helper'

describe "In the dashboard, Navigations", type: :feature do

  before{ login_admin }

  it "renders the navigations index" do
    visit dashboard_navigations_path
    expect(page).to have_content I18n.t('storytime.dashboard.navigations.index.header')
  end

  it "creates a new navigation list" do
    visit new_dashboard_navigation_path

    expect{
      fill_in "navigation_name", with: "Main Navigation"
      fill_in "navigation_handle", with: "main"
      find("input[name='commit']").click()
    }.to change(Storytime::Navigation, :count).by(1)
  end

  it "updates a navigation list" do
    Storytime::Site.current_id = current_site.id
    nav = FactoryGirl.create(:navigation, site_id: current_site.id)
    visit edit_dashboard_navigation_path(nav)

    fill_in "navigation_name", with: "New Name"
    find("input[name='commit']").click()

    nav.reload
    expect(nav.name).to eq "New Name"
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
storytime-2.1.6 spec/features/dashboard/navigations_spec.rb
storytime-2.1.5 spec/features/dashboard/navigations_spec.rb
storytime-2.1.4 spec/features/dashboard/navigations_spec.rb
storytime-2.1.3 spec/features/dashboard/navigations_spec.rb
storytime-2.1.2 spec/features/dashboard/navigations_spec.rb
storytime-2.1.1 spec/features/dashboard/navigations_spec.rb
storytime-2.1.0 spec/features/dashboard/navigations_spec.rb