Sha256: bf11ddb42db16b4e3e55a6077cb0611e9aa52196675ffc90f7fae955477c5dc4
Contents?: true
Size: 1.65 KB
Versions: 1
Compression:
Stored size: 1.65 KB
Contents
require 'rails_helper' describe Pulitzer::PartialsController do routes { Pulitzer::Engine.routes } render_views let(:post_type) { Pulitzer::PostType.create(name: 'Centered Text White BG', plural: true, kind: Pulitzer::PostType.kinds[:partial]) } let(:free_form_section) { Pulitzer::FreeFormSection.create(name: 'free as a bird') } let(:partial) { free_form_section.partials.create(post_type_id: post_type.id, label: 'test partial') } describe "#amenities", type: :request do it "renders the new form" do post_type get pulitzer.new_partial_path partial: {free_form_section_id: free_form_section.id} expect(response.status).to eq 200 expect(response.body).to match post_type.name end it "creates a new partial" do post pulitzer.partials_path partial: {post_type_id: post_type.id, free_form_section_id: free_form_section.id} expect(response.status).to eq 200 partial = Pulitzer::Partial.order(id: :desc).first expect(partial.free_form_section_id).to eq free_form_section.id expect(partial.post_type_id).to eq post_type.id end it "edits a partial" do get pulitzer.edit_partial_path id: partial.id expect(response.status).to eq 200 expect(response.body).to match partial.label end it "updates a partial" do other_post_type = Pulitzer::PostType.create(name: 'Left Text White BG', plural: true, kind: Pulitzer::PostType.kinds[:partial]) patch pulitzer.partial_path id: partial.id, partial: {post_type_id: other_post_type.id} expect(response.status).to eq 200 expect(partial.reload.name).to eq 'Left Text White BG' end end # /search end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pulitzer-0.13.0 | spec/controllers/pulitzer/partials_controller_spec.rb |