internetee-registry/spec/requests/admin/billing/prices/destroy_spec.rb
Artur Beljajev 5a533e09bf Refactor prices
#475
2017-04-26 00:51:06 +03:00

18 lines
424 B
Ruby

require 'rails_helper'
RSpec.describe 'admin price destroy', settings: false do
let!(:price) { create(:price) }
before :example do
sign_in_to_admin_area
end
it 'deletes price' do
expect { delete admin_price_path(price) }.to change { Billing::Price.count }.from(1).to(0)
end
it 'redirects to :index' do
delete admin_price_path(price)
expect(response).to redirect_to admin_prices_url
end
end