Guest User

Untitled

a guest
Mar 19th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. RSpec.describe Api::V1::AreaService do
  2. Service=Api::V1::AreaService // I will be using Service instead of Api::V1::AreaService
  3. it 'should save a new area' do
  4. expect {
  5. Service.add 'some', 'area' // This is one example
  6. }.to change(Area, :count).by(1)
  7. end
  8. end
  9.  
  10. class MyModule::AreaController < MyModule::MainController
  11. Service = Api::V1::AreaService
  12. def add
  13. area = params['area']
  14. city = params['city']
  15. Service.add area, city
  16. end
  17. end
Add Comment
Please, Sign In to add comment