TokiTranslate/spec/requests/dictionary_spec.rb

28 lines
647 B
Ruby

require 'rails_helper'
RSpec.describe "Dictionary", type: :request do
describe "GET /index" do
it 'renders the index template' do
get "/dictionary"
expect(response).to render_template(:index)
end
end
describe "GET /show" do
it 'renders the show template' do
get "/dictionary/a"
expect(response).to render_template(:show)
end
it "sets @letter instance variable" do
get "/dictionary/a"
expect(assigns(:letter)).to be_a(String)
end
it "sets @words instance variable" do
get "/dictionary/a"
expect(assigns(:words)).to be_a(ActiveRecord::Relation)
end
end
end