Skip to content

Commit 32ffa20

Browse files
committed
Rels and static controllers spec
1 parent a0d2ed1 commit 32ffa20

3 files changed

Lines changed: 37 additions & 1 deletion

File tree

app/controllers/api/rels_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ def index
66
def show
77
@rel = Rel.first(:slug => params[:id])
88
end
9-
end
9+
end
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
require 'spec_helper'
2+
3+
describe Api::RelsController do
4+
5+
let(:slug){Fabricate(:rel)}
6+
7+
8+
describe "GET index" do
9+
it "responds with success" do
10+
get :index
11+
response.should be_success
12+
end
13+
end
14+
15+
describe "GET show" do
16+
it "responds with success" do
17+
get :show
18+
response.should be_success
19+
end
20+
end
21+
end

spec/controllers/static_controller_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,19 @@
66
expect(:get => "/").to route_to(:controller => "static", :action => "root")
77
end
88
end
9+
10+
describe "GET api_root" do
11+
it "should render api layout" do
12+
get :api_root
13+
response.should render_template(:layout => "api")
14+
end
15+
end
16+
17+
describe "GET newest_version" do
18+
it "should render version of api" do
19+
get :newest_version
20+
response.header['Content-Type'].should include 'application/json'
21+
response.body.should include "1.0.0".to_json
22+
end
23+
end
924
end

0 commit comments

Comments
 (0)