2023-10-13 23:42:17 +00:00
|
|
|
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
|
2023-10-20 18:29:34 +00:00
|
|
|
|
|
|
|
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
|
2023-10-13 23:42:17 +00:00
|
|
|
end
|