diff options
| author | Robert | 2017-07-17 12:11:43 +0200 | 
|---|---|---|
| committer | Robert | 2017-07-17 13:13:29 +0200 | 
| commit | 4f4d43779ed3f9e6d1752dbe00d698bcc1a04966 (patch) | |
| tree | e53010bc5236edc31a958e25c3773abc3f992cfb /spec | |
| parent | 03c2dcba29f1d6b4a8d22bd091e036fcf5600924 (diff) | |
| download | chouette-core-4f4d43779ed3f9e6d1752dbe00d698bcc1a04966.tar.bz2 | |
Refs: #3506@1.5h sketching out specs [amend me]
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/models/api/v1/netex_import_spec.rb | 15 | ||||
| -rw-r--r-- | spec/routing/api/v1/access_links_routes_spec.rb | 9 | ||||
| -rw-r--r-- | spec/routing/api/v1/import_routes_spec.rb | 10 | ||||
| -rw-r--r-- | spec/routing/group_of_lines_spec.rb | 4 | 
4 files changed, 35 insertions, 3 deletions
diff --git a/spec/models/api/v1/netex_import_spec.rb b/spec/models/api/v1/netex_import_spec.rb new file mode 100644 index 000000000..f1fddc4ba --- /dev/null +++ b/spec/models/api/v1/netex_import_spec.rb @@ -0,0 +1,15 @@ +RSpec.describe Api::V1::NetexImportController, type: :controller do + +  context 'POST create' do + +    let( :netex_import ){ build_stubbed(:netex_import) } + +    it 'creates a NetexImport record' do +      expect_any_instance_of( ImportController ).to receive(:create).with( +        params: netex_import.attributes +      ) +       +    end +  end + +end diff --git a/spec/routing/api/v1/access_links_routes_spec.rb b/spec/routing/api/v1/access_links_routes_spec.rb new file mode 100644 index 000000000..9164d3f05 --- /dev/null +++ b/spec/routing/api/v1/access_links_routes_spec.rb @@ -0,0 +1,9 @@ +RSpec.describe Api::V1::AccessLinksController, type: :controller do +   +  it 'routes to index' do +    expect( get: '/api/v1/access_links' ).to route_to( +      controller: 'api/v1/access_links', +      action: 'index' +    ) +  end +end diff --git a/spec/routing/api/v1/import_routes_spec.rb b/spec/routing/api/v1/import_routes_spec.rb new file mode 100644 index 000000000..7acc0e82d --- /dev/null +++ b/spec/routing/api/v1/import_routes_spec.rb @@ -0,0 +1,10 @@ +RSpec.describe Api::V1::ImportsController do +  describe "routing" do +    it {  +        expect(post: '/api/v1/imports').to route_to( +          controller: 'api/v1/imports', +          action: 'create' +        )  +    } +  end +end diff --git a/spec/routing/group_of_lines_spec.rb b/spec/routing/group_of_lines_spec.rb index 2a7262893..01ebeefe4 100644 --- a/spec/routing/group_of_lines_spec.rb +++ b/spec/routing/group_of_lines_spec.rb @@ -1,6 +1,4 @@ -require 'spec_helper' - -describe GroupOfLinesController do +RSpec.describe GroupOfLinesController do    describe "routing" do      it "not recognize #routes" do        expect(get( "/line_referentials/1/group_of_lines/2/routes")).not_to route_to(  | 
