Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RSpec.describe Api::V1::AreaService do
- Service=Api::V1::AreaService // I will be using Service instead of Api::V1::AreaService
- it 'should save a new area' do
- expect {
- Service.add 'some', 'area' // This is one example
- }.to change(Area, :count).by(1)
- end
- end
- class MyModule::AreaController < MyModule::MainController
- Service = Api::V1::AreaService
- def add
- area = params['area']
- city = params['city']
- Service.add area, city
- end
- end
Add Comment
Please, Sign In to add comment