Skip to content

Commit

Permalink
template_controller_spec: add test for create action
Browse files Browse the repository at this point in the history
  • Loading branch information
ndushay committed Aug 30, 2018
1 parent 27e7c62 commit 08dd13e
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions spec/controllers/template_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,26 @@

RSpec.describe TemplateController, type: :controller do

it "renders the index template" do
get :index
expect(response).to render_template("index")
context 'GET index' do
it "renders the index template" do
get :index
expect(response).to render_template("index")
end
it "is successful" do
get :index
expect(response.status).to eq(200)
end
end

context "POST create" do
it "renders the create template" do
post :create
expect(response).to render_template("create")
end
it "is successful" do
post :create
expect(response.status).to eq(200)
end
end

end

0 comments on commit 08dd13e

Please sign in to comment.