Skip to content
Browse files

Rels and static controllers spec

  • Loading branch information...
1 parent a0d2ed1 commit 32ffa202f773de5a292e40986c1e29cffe2e0561 @ArturG ArturG committed
View
2 app/controllers/api/rels_controller.rb
@@ -6,4 +6,4 @@ def index
def show
@rel = Rel.first(:slug => params[:id])
end
-end
+end
View
21 spec/controllers/rel_controller_spec.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe Api::RelsController do
+
+ let(:slug){Fabricate(:rel)}
+
+
+ describe "GET index" do
+ it "responds with success" do
+ get :index
+ response.should be_success
+ end
+ end
+
+ describe "GET show" do
+ it "responds with success" do
+ get :show
+ response.should be_success
+ end
+ end
+end
View
15 spec/controllers/static_controller_spec.rb
@@ -6,4 +6,19 @@
expect(:get => "/").to route_to(:controller => "static", :action => "root")
end
end
+
+ describe "GET api_root" do
+ it "should render api layout" do
+ get :api_root
+ response.should render_template(:layout => "api")
+ end
+ end
+
+ describe "GET newest_version" do
+ it "should render version of api" do
+ get :newest_version
+ response.header['Content-Type'].should include 'application/json'
+ response.body.should include "1.0.0".to_json
+ end
+ end
end

0 comments on commit 32ffa20

Please sign in to comment.
Something went wrong with that request. Please try again.