diff options
| author | mo khan <mo@mokhan.ca> | 2014-02-21 23:29:26 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-02-21 23:29:26 -0700 |
| commit | d0aaa1ee5724c4981aba10efeb7e9abde27da13d (patch) | |
| tree | c4766518aabd80b87f4a69141e80f8cf368a83e2 /spec/controllers | |
| parent | dcb8cddfc3adeb3be6885c00933f1354d3d1e576 (diff) | |
add integration test and add township query method.
Diffstat (limited to 'spec/controllers')
| -rw-r--r-- | spec/controllers/v1/company_licenses_controller_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/controllers/v1/company_licenses_controller_spec.rb b/spec/controllers/v1/company_licenses_controller_spec.rb index 2784a1d..198b4f3 100644 --- a/spec/controllers/v1/company_licenses_controller_spec.rb +++ b/spec/controllers/v1/company_licenses_controller_spec.rb @@ -28,4 +28,17 @@ describe V1::CompanyLicensesController do assigns(:active_licenses).should == active_licenses_in_township end end + + describe :integration do + describe :index do + let(:company) { Company.create(name: 'ABC Resources Ltd.') } + let(:location) { Location.new(latitude: 51.06, longitude: -114.09, township: '1') } + let!(:license) { company.licenses.create(well_type: WellType::DEV, location: location, issued_at: 2.days.ago, expired_at: 1.day.ago) } + + it "finds expired licenses from a specific township" do + xhr :get, :index, company_id: company.id, status: "expired", township: "1" + assigns(:active_licenses).should include(license) + end + end + end end |
