Merge master (with primary taxons restored)

This commit is contained in:
Rob H
2014-05-30 15:45:48 +10:00
38 changed files with 195 additions and 83 deletions

View File

@@ -0,0 +1,15 @@
require 'spec_helper'
feature "Authentication", js: true do
include UIComponentHelper
let(:user) { create(:user, password: "password", password_confirmation: "password") }
scenario "logging into admin redirects home, then back to admin" do
visit spree.admin_path
fill_in "Email", with: user.email
fill_in "Password", with: user.password
click_login_button
page.should have_content "Dashboard"
current_path.should == spree.admin_path
end
end

View File

@@ -223,20 +223,19 @@ feature %q{
scenario "creating a new product" do
s = FactoryGirl.create(:supplier_enterprise)
d = FactoryGirl.create(:distributor_enterprise)
taxon = create(:taxon)
login_to_admin_section
visit '/admin/products/bulk_edit'
#save_screenshot "/Users/willmarshall/Desktop/foo.png"
#save_and_open_page
find("a", text: "NEW PRODUCT").click
page.should have_content 'NEW PRODUCT'
fill_in 'product_name', :with => 'Big Bag Of Apples'
select(s.name, :from => 'product_supplier_id')
fill_in 'product_price', :with => '10.00'
select taxon.name, from: 'product_primary_taxon_id'
click_button 'Create'
URI.parse(current_url).path.should == '/admin/products/bulk_edit'

View File

@@ -6,6 +6,7 @@ feature %q{
} do
include AuthenticationWorkflow
include WebHelper
let!(:taxon) { create(:taxon) }
background do
@supplier = create(:supplier_enterprise, :name => 'New supplier')
@@ -22,6 +23,7 @@ feature %q{
fill_in 'product_name', with: 'A new product !!!'
fill_in 'product_price', with: '19.99'
select taxon.name, from: "product_primary_taxon_id"
select 'New supplier', from: 'product_supplier_id'
click_button 'Create'
@@ -43,6 +45,8 @@ feature %q{
product.reload
product.distributors.sort.should == [@distributors[0], @distributors[2]].sort
product.product_distributions.map { |pd| pd.enterprise_fee }.sort.should == [@enterprise_fees[0], @enterprise_fees[2]].sort
end
@@ -96,6 +100,7 @@ feature %q{
page.should have_selector('#product_supplier_id')
select 'Another Supplier', :from => 'product_supplier_id'
select taxon.name, from: "product_primary_taxon_id"
# Should only have suppliers listed which the user can manage
within "#product_supplier_id" do