Sha256: c9948ef4bead000e0d3d41e474c297cff559f7094384384a746dd98e80f9bbf7
Contents?: true
Size: 1.08 KB
Versions: 11
Compression:
Stored size: 1.08 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) page.title.should 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) page.title.should eq "Edit Post" end end end end
Version data entries
11 entries across 11 versions & 2 rubygems