Sha256: 35d7ea12ec2e0c23d96cc1d53e1b0ae65d22e1b5b7aadea7a6cd6d7eac09a7a6
Contents?: true
Size: 947 Bytes
Versions: 8
Compression:
Stored size: 947 Bytes
Contents
require 'rails_helper' describe Pulitzer::PostTypesController do routes { Pulitzer::Engine.routes } render_views describe "#create", type: :request do it "Creates a plural post type without an intial post" do post pulitzer.post_types_path post_type: { name: 'Flock of birds', kind: 'template', plural: '1' } expect(response.status).to eq 200 expect(response.body).to match /Flock of birds/ expect(Pulitzer::PostType.find_by(name: 'Flock of birds').posts.any?).to be false end it "Creates a single post type with an intial post" do post pulitzer.post_types_path post_type: { name: 'Crow', kind: 'template', plural: '0' } post_type = Pulitzer::PostType.find_by(name: 'Crow') expect(response.status).to eq 200 expect(response.body).to match post_type.name expect(post_type.posts.count).to eq 1 expect(post_type.posts.first.title).to eq post_type.name end end end
Version data entries
8 entries across 8 versions & 1 rubygems