Sha256: 65fd90c3280628126a2517d9a23e3897abdfd970567715d21af21551695fab80
Contents?: true
Size: 1.02 KB
Versions: 14
Compression:
Stored size: 1.02 KB
Contents
require 'spec_helper' describe Spree::Admin::ProductsController do stub_authorization! describe "on :index" do it "renders index" do spree_get :index expect(response).to be_success end end describe "on a PUT to :update" do before(:each) do @product = FactoryGirl.create(:product) @store = FactoryGirl.create(:store) end describe "when no stores are selected" do it "clears stores if they previously existed" do @product.stores << @store spree_put :update, :id => @product.to_param, :product => {:name => @product.name}, update_store_ids: 'true' expect(@product.reload.store_ids).to be_empty end end describe "when a store is selected" do it "clears stores" do spree_put :update, :id => @product.to_param, :product => {:name => @product.name, :store_ids => [@store.id]}, update_store_ids: 'true' expect(@product.reload.store_ids).to eq [@store.id] end end end end
Version data entries
14 entries across 14 versions & 1 rubygems