Sha256: 2aa5d8ef71d244c2f2fcc570889bce564a14094902bbda4394bdd4854797398b

Contents?: true

Size: 638 Bytes

Versions: 8

Compression:

Stored size: 638 Bytes

Contents

describe PagesController, type: :controller do
  let(:page_name) { "about_page" }
  context "content exists" do
    describe "GET #show" do
      let(:page) { ContentBlock.create!(name: page_name, value: "foo bar") }

      it "updates the node" do
        get :show, id: page.name
        expect(response).to be_successful
        expect(assigns[:page]).to eq page
      end
    end
  end
  context "content does not exist" do
    describe "GET #show" do
      it "creates the node" do
        get :show, id: "about_page"
        expect(response).to be_successful
        expect(assigns[:page]).not_to be_nil
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sufia-7.1.0 spec/controllers/pages_controller_spec.rb
sufia-7.0.0 spec/controllers/pages_controller_spec.rb
sufia-7.0.0.rc2 spec/controllers/pages_controller_spec.rb
sufia-7.0.0.rc1 spec/controllers/pages_controller_spec.rb
sufia-7.0.0.beta4 spec/controllers/pages_controller_spec.rb
sufia-7.0.0.beta3 spec/controllers/pages_controller_spec.rb
sufia-7.0.0.beta2 spec/controllers/pages_controller_spec.rb
sufia-7.0.0.beta1 spec/controllers/pages_controller_spec.rb