Sha256: 1e19d8580ca1da84b78a9347686c6f3a4d88fe0b24de7beb363a8f289c4ced54

Contents?: true

Size: 1.45 KB

Versions: 7

Compression:

Stored size: 1.45 KB

Contents

require 'spec_helper'

describe "Taxonomies", :type => :feature do
  stub_authorization!

  before(:each) do
    visit spree.admin_path
    click_link "Settings"
  end

  context "show" do
    it "should display existing taxonomies" do
      create(:taxonomy, :name => 'Brand')
      create(:taxonomy, :name => 'Categories')
      click_nav "Products", "Taxonomies"
      within_row(1) { expect(page).to have_content("Brand") }
      within_row(2) { expect(page).to have_content("Categories") }
    end
  end

  context "create" do
    before(:each) do
      click_nav "Products", "Taxonomies"
      click_link "admin_new_taxonomy_link"
    end

    it "should allow an admin to create a new taxonomy" do
      expect(page).to have_content("New Taxonomy")
      fill_in "taxonomy_name", :with => "sports"
      click_button "Create"
      expect(page).to have_content("successfully created!")
    end

    it "should display validation errors" do
      fill_in "taxonomy_name", :with => ""
      click_button "Create"
      expect(page).to have_content("can't be blank")
    end
  end

  context "edit" do
    it "should allow an admin to update an existing taxonomy" do
      create(:taxonomy)
      click_nav "Products", "Taxonomies"
      within_row(1) { click_icon :edit }
      fill_in "taxonomy_name", :with => "sports 99"
      click_button "Update"
      expect(page).to have_content("successfully updated!")
      expect(page).to have_content("sports 99")
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
solidus_backend-1.2.3 spec/features/admin/configuration/taxonomies_spec.rb
solidus_backend-1.2.2 spec/features/admin/configuration/taxonomies_spec.rb
solidus_backend-1.2.1 spec/features/admin/configuration/taxonomies_spec.rb
solidus_backend-1.2.0 spec/features/admin/configuration/taxonomies_spec.rb
solidus_backend-1.2.0.rc2 spec/features/admin/configuration/taxonomies_spec.rb
solidus_backend-1.2.0.rc1 spec/features/admin/configuration/taxonomies_spec.rb
solidus_backend-1.2.0.beta1 spec/features/admin/configuration/taxonomies_spec.rb