diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/controllers/v1/company_licenses_controller_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/controllers/v1/company_licenses_controller_spec.rb b/spec/controllers/v1/company_licenses_controller_spec.rb index 198b4f3..e811179 100644 --- a/spec/controllers/v1/company_licenses_controller_spec.rb +++ b/spec/controllers/v1/company_licenses_controller_spec.rb @@ -2,18 +2,18 @@ require "spec_helper" describe V1::CompanyLicensesController do describe :index do - let(:company) { Object.new } + let(:company) { Company.new } let(:company_id) { SecureRandom.uuid } let(:active_licenses) { ["active"] } let(:active_licenses_in_township) { ["active township"] } before :each do Company.stub(:find).with(company_id).and_return(company) - company.stub(:status).with(LicenseStatus::ACTIVE).and_return(active_licenses) active_licenses.stub(:township).with("123").and_return(active_licenses_in_township) end it "returns the active licenses" do + company.stub(:filter_licenses_using).with({status: LicenseStatus::ACTIVE, township: nil}).and_return(active_licenses) xhr :get, :index, company_id: company_id assigns(:active_licenses).should == active_licenses end @@ -24,6 +24,7 @@ describe V1::CompanyLicensesController do 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) xhr :get, :index, company_id: company_id, township: "123" assigns(:active_licenses).should == active_licenses_in_township end |
