diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/views/v1/company_licenses/index.json.jbuilder_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/views/v1/company_licenses/index.json.jbuilder_spec.rb b/spec/views/v1/company_licenses/index.json.jbuilder_spec.rb new file mode 100644 index 0000000..52b5fe5 --- /dev/null +++ b/spec/views/v1/company_licenses/index.json.jbuilder_spec.rb @@ -0,0 +1,18 @@ +require "spec_helper" + +describe 'v1/company_licenses/index' do + let!(:company) { Company.create(name: 'acme') } + let!(:license) { company.licenses.create(issued_at: 2.days.ago, expired_at: 1.day.from_now) } + + before :each do + assign(:licenses, company.licenses) + render + end + + let(:result) { JSON.parse(rendered) } + + it "includes the license date range" do + result.first["issued_at"].should == license.issued_at.to_s + result.first["expired_at"].should == license.expired_at.to_s + end +end |
