From 24e1bf2c931fe0dc6c8fc267c4e43ba2a8fae6bb Mon Sep 17 00:00:00 2001 From: mo khan Date: Thu, 27 Feb 2014 18:42:09 -0700 Subject: remove unnecessary stub. --- spec/controllers/v1/company_licenses_controller_spec.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'spec/controllers') diff --git a/spec/controllers/v1/company_licenses_controller_spec.rb b/spec/controllers/v1/company_licenses_controller_spec.rb index 0ba61eb..636537c 100644 --- a/spec/controllers/v1/company_licenses_controller_spec.rb +++ b/spec/controllers/v1/company_licenses_controller_spec.rb @@ -7,19 +7,16 @@ describe V1::CompanyLicensesController do let(:active_licenses) { ["active"] } let(:active_licenses_in_township) { ["active township"] } - before :each do - Company.stub(:find).with(company_id).and_return(company) - active_licenses.stub(:township).with("123").and_return(active_licenses_in_township) - end + before { Company.stub(:find).with(company_id).and_return(company) } it "returns the active licenses" do - company.stub(:filter_licenses_using).with({status: LicenseStatus::ACTIVE, township: nil}).and_return(active_licenses) + company.stub(:filter_licenses_using).with(status: LicenseStatus::ACTIVE, township: nil).and_return(active_licenses) get :index, company_id: company_id assigns(:licenses).should == active_licenses end it "returns the active licenses for a given township" do - company.stub(:filter_licenses_using).with({status: LicenseStatus::ACTIVE, township: "123"}).and_return(active_licenses_in_township) + company.stub(:filter_licenses_using).with(status: LicenseStatus::ACTIVE, township: "123").and_return(active_licenses_in_township) get :index, company_id: company_id, township: "123" assigns(:licenses).should == active_licenses_in_township end -- cgit v1.2.3