diff options
| author | mo khan <mo@mokhan.ca> | 2014-02-21 21:54:15 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-02-21 21:54:15 -0700 |
| commit | 476bee1ff1e1c0d4fe553898f5f029530a41919c (patch) | |
| tree | 70e3d78c2f6ab0b7f2f10be274f202091014430a /spec | |
| parent | fe13da4831bade3b7292d5143ab7267edd4a63df (diff) | |
start to build the json specs.
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 |
