Sha256: b83dc83c533f4395dff0ad181ee2cee76db5df1b12dc0b23a4b7d9ea5e8bc8c5
Contents?: true
Size: 1.4 KB
Versions: 8
Compression:
Stored size: 1.4 KB
Contents
require 'rails_helper' module Pwb RSpec.describe PropsController, type: :controller do routes { Pwb::Engine.routes } let(:prop_for_long_term_rent) { FactoryGirl.create(:pwb_prop, :long_term_rent, price_rental_monthly_current_cents: 100_000) } let(:prop_for_sale) { FactoryGirl.create(:pwb_prop, :sale, price_sale_current_cents: 10_000_000) } describe 'GET #show_for_rent' do it 'renders correct template' do expect(get(:show_for_rent, params: { id: prop_for_long_term_rent.id, url_friendly_title: "tt" })).to render_template('pwb/props/show') end end describe 'GET #show_for_sale' do context 'with id of for sale prop' do it 'renders correct template' do expect(get(:show_for_sale, params: { id: prop_for_sale.id, url_friendly_title: "tt" })).to render_template('pwb/props/show') end end context 'with id of for rent prop' do it 'renders correct template' do expect(get(:show_for_sale, params: { id: prop_for_long_term_rent.id, url_friendly_title: "tt" })).to render_template('pwb/props/not_found') end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems