Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MelnikVasya/cfda7bd06c35a2403ed1 to your computer and use it in GitHub Desktop.
Save MelnikVasya/cfda7bd06c35a2403ed1 to your computer and use it in GitHub Desktop.
require "spec_helper"
RSpec.describe WelcomeController, :type => :controller do
describe "GET home" do
it "returns http success" do
get :home
expect(response).to be_success
end
it "renders the home template" do
get :home
expect(response).to render_template("home")
end
end
describe "GET about" do
it "returns http success" do
get :about
expect(response).to be_success
end
it "renders the about template" do
get :about
expect(response).to render_template("about")
end
end
describe "GET contact" do
it "returns http success" do
get :contact
expect(response).to be_success
end
it "renders the contact template" do
get :contact
expect(response).to render_template("contact")
end
end
end
require "spec_helper"
RSpec.describe WelcomeController, :type => :controller do
welcomes = %w{portfolio about contact}
welcomes.each do |welcome|
describe "GET #{welcome}" do
it "returns http success" do
get welcome.to_sym
expect(response).to be_success
end
it "renders the #{welcome} template" do
get welcome.to_sym
expect(response).to render_template(welcome)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment