Dictionary show action for letters, alphabetical links helper

This commit is contained in:
maddiebaka
2023-10-20 14:29:34 -04:00
parent 6202a6e778
commit c5cbffb4e5
9 changed files with 93 additions and 1 deletions

View File

@@ -7,4 +7,21 @@ RSpec.describe "Dictionary", type: :request do
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