Dictionary show action for letters, alphabetical links helper
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user