Fixing specs

This commit is contained in:
Rob Harrington
2014-10-24 14:52:59 +11:00
parent 8ac367675f
commit 8b819539e7
4 changed files with 5 additions and 21 deletions

View File

@@ -4,7 +4,7 @@ module Api
before_filter :override_owner, only: [:create, :update]
before_filter :check_type, only: :update
before_filter :override_sells, only: [:create, :update]
before_filter :override_visiblity, only: [:create, :update]
before_filter :override_visible, only: [:create, :update]
respond_to :json
def managed

View File

@@ -25,7 +25,7 @@ feature %q{
it "displays a message when number of products is zero" do
visit '/admin/products/bulk_edit'
expect(page).to have_text "No products found."
expect(page).to have_text "No products yet. Why don't you add some?"
end
it "displays a select box for suppliers, with the appropriate supplier selected" do

View File

@@ -28,11 +28,13 @@ feature %q{
end
end
context "with an enterprise" do
context "with multiple enterprises" do
let(:d1) { create(:distributor_enterprise) }
let(:d2) { create(:distributor_enterprise) }
before :each do
@enterprise_user.enterprise_roles.build(enterprise: d1).save
@enterprise_user.enterprise_roles.build(enterprise: d2).save
end
it "displays information about the enterprise" do

View File

@@ -18,22 +18,4 @@ describe Api::EnterpriseSerializer do
serializer = Api::EnterpriseSerializer.new enterprise
serializer.to_json.should match "map_005-hub.svg"
end
describe "visibility" do
before do
enterprise.stub(:visible).and_return true
end
it "is visible when confirmed" do
enterprise.stub(:confirmed?).and_return true
serializer = Api::EnterpriseSerializer.new enterprise
expect(serializer.to_json).to match "\"visible\":true"
end
it "is not visible when unconfirmed" do
enterprise.stub(:confirmed?).and_return false
serializer = Api::EnterpriseSerializer.new enterprise
expect(serializer.to_json).to match "\"visible\":false"
end
end
end