Skip to content

Instantly share code, notes, and snippets.

View andressamachado's full-sized avatar

Andressa Machado andressamachado

View GitHub Profile
@andressamachado
andressamachado / rspec_rails_cheetsheet.rb
Created January 18, 2024 22:32 — forked from them0nk/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
# syntax=docker/dockerfile:1
# Defining the base image layer from which the container will be build, in our case golang as we are using Go to setup the server.
# I got image from Docker hub Official Images webpage. https://hub.docker.com/_/golang
FROM golang:1.16.10-alpine
# Default port value
ARG GO_SERVER_PORT=3030
# Creating a default directory to live inside the container