Created
October 7, 2014 11:28
-
-
Save duketon/b3cdc967d46a6857fdfa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rails_helper" | |
RSpec.describe "Students routes" do | |
describe "GET /students" do | |
it "routes to #index" do | |
expect(:get => "http://api.skillscourt.dev/v1/students").to route_to( | |
:format => "json", :action => "index", :controller => "api/v1/students") | |
end | |
context "with valid multiple subdomains" do | |
it "routes to #index" do | |
expect(:get => "http://api.this.is.a.test.skillscourt.dev/v1/students").to route_to( | |
:format => "json", :action => "index", :controller => "api/v1/students") | |
end | |
end | |
context "with invalid multiple subdomains" do | |
it "does not route to #index" do | |
expect(:get => "http://0098234.api.this.is.a.test.skillscourt.dev/v1/students").to_not route_to( | |
:format => "json", :action => "index", :controller => "api/v1/students") | |
end | |
end | |
end | |
describe "GET /students/:id" do | |
it "routes to #show" do | |
expect(:get => "http://api.skillscourt.dev/v1/students/1").to route_to( | |
:format => "json", :action => "show", :controller => "api/v1/students", :id => "1") | |
end | |
context "with valid multiple subdomains" do | |
it "routes to #show" do | |
expect(:get => "http://api.this.is.a.test.skillscourt.dev/v1/students/1").to route_to( | |
:format => "json", :action => "show", :controller => "api/v1/students", :id => "1") | |
end | |
end | |
context "with invalid multiple subdomains" do | |
it "does not route to #show" do | |
expect(:get => "http://0098234.api.skillscourt.dev/v1/students").to_not route_to( | |
:format => "json", :action => "show", :controller => "api/v1/students", :id => "1") | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment