RSpec 3에서 마이그레이션 한 후 요청 테스트가 실패합니다. 여기 여기 내 테스트RSpec 3 정의되지 않은 메소드 'get'요청 테스트에서
describe 'GET /api/v1/activities' do
let!(:user) { create(:user) }
subject { json['activities'] }
context 'when not authenticated' do
let(:token) { user.authentication_token }
let(:email) { '[email protected]' }
before :each do
get '/api/v1/activities', {}, {token: token, email: email}
end
it { expect(response).to_not be_success }
end
end
입니다 RSpec에 로그
Activities GET /api/v1/activities when not authenticated
Failure/Error: get '/api/v1/activities', {}, {token: token, email: email}
NoMethodError:
undefined method `get' for #<RSpec::ExampleGroups::Activities::GETApiV1Activities::WhenNotAuthenticated:0x0000000becfaf8>
는 무엇을 할 수 있습니까?
이 문자열은'spec_helper' config.include Requests :: JsonHelpers, type : : request'에 있습니다. 동일하지 않습니까? 또한 나는 이미 나를 도울 해결책을 찾는다. 그러나 나는 동시에 그것을 게시하기에 충분한 명성이 없다. 당신과 당신의 해결책이 어떻게 상대적인 것이라고 생각합니까? –