diff options
| author | mo khan <mo@mokhan.ca> | 2014-02-22 08:30:56 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-02-22 08:30:56 -0700 |
| commit | 1388b346450b975703b7890eb87505e975713c22 (patch) | |
| tree | 7e2b22daa48a47d02c3533ba01786f68d8c995e1 /spec/views/v1 | |
| parent | 32c64df4b8b48f87c6e9a3c86496eed85a1d078c (diff) | |
add the license status to the json response.
Diffstat (limited to 'spec/views/v1')
| -rw-r--r-- | spec/views/v1/licenses/show.json.jbuilder_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/views/v1/licenses/show.json.jbuilder_spec.rb b/spec/views/v1/licenses/show.json.jbuilder_spec.rb index db8730f..404a514 100644 --- a/spec/views/v1/licenses/show.json.jbuilder_spec.rb +++ b/spec/views/v1/licenses/show.json.jbuilder_spec.rb @@ -10,6 +10,7 @@ describe 'v1/licenses/show' do let(:public_license) { License.new(id: SecureRandom.uuid, company: company, applicant: user, location: location, issued_at: 2.days.ago, expired_at: 1.day.from_now, well_type: well_type) } before :each do + public_license.stub(:status).and_return('active') assign(:license, public_license) render end @@ -41,12 +42,17 @@ describe 'v1/licenses/show' do result["location"]["longitude"].should == location.longitude result["location"]["township"].should == location.township end + + it "includes the license status" do + result['status'].should == 'active' + end end context "for confidential licenses" do let(:confidential_license) { License.new(confidential: true, company: company, applicant: user, location: location, well_type: well_type) } before :each do + confidential_license.stub(:status).and_return('confidential') assign(:license, confidential_license) render end @@ -66,5 +72,9 @@ describe 'v1/licenses/show' do it "should hide the company name" do result["company"]["name"].should == "CONFIDENTIAL" end + + it "includes the license status" do + result['status'].should == 'confidential' + end end end |
