Sha256: 753f3efe69f8b689f9b76a89896e84c53c9f722445bf5ee0bb41c4b3bec99e48
Contents?: true
Size: 1.07 KB
Versions: 5
Compression:
Stored size: 1.07 KB
Contents
require "spec_helper" describe ActiveAdmin::Views::Pages::Form do describe "#title" do let!(:application){ ActiveAdmin::Application.new } let(:namespace){ ActiveAdmin::Namespace.new(application, "Admin") } let!(:params){ { controller: "UsersController", action: "edit" } } let(:helpers) do helpers = mock_action_view helpers.stub active_admin_config: namespace.register(Post), params: params helpers end let(:arbre_context) do OpenStruct.new(params: params, helpers: helpers, assigns: {}) end context "when page_title is assigned" do it "should show the set page title" do arbre_context.assigns[:page_title] = "My Page Title" page = ActiveAdmin::Views::Pages::Form.new(arbre_context) expect(page.title).to eq "My Page Title" end end context "when page_title is not assigned" do it "should show the correct I18n text" do page = ActiveAdmin::Views::Pages::Form.new(arbre_context) expect(page.title).to eq "Edit Post" end end end end
Version data entries
5 entries across 5 versions & 2 rubygems