Sha256: 31a835a034bf69b6bafff43208e44e5f6dda4deb16ac2c8afd43e8bb8452156e
Contents?: true
Size: 658 Bytes
Versions: 3
Compression:
Stored size: 658 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' RSpec.describe Addresses::CitiesController, type: :controller do routes { Addresses::Engine.routes } let!(:state) { create :state } let!(:city) { create :city, state: state } describe "GET #index" do before { get :index, params: { state_id: state.id, format: :json } } it { expect(response).to have_http_status(:success) } it { expect(assigns(:cities)).to eq([city]) } end describe "GET #show" do before { get :show, params: { id: city.id, format: :json } } it { expect(response).to have_http_status(:success) } it { expect(assigns(:city)).to eq(city) } end end
Version data entries
3 entries across 3 versions & 1 rubygems