Sha256: e85bf318c1b3934cb5514ae35ac54e07a0ff32016a395ab7f676da60ecb03ad0
Contents?: true
Size: 1.06 KB
Versions: 2
Compression:
Stored size: 1.06 KB
Contents
require 'spec_helper' class ActionController::Base attr_reader :rendered def render(*args, &block) @rendered = true end end class MetaTagsController < ActionController::Base def index @page_title = 'title' @page_keywords = 'key1, key2, key3' @page_description = 'description' render end public :set_meta_tags, :meta_tags end describe MetaTags::ControllerHelper do subject { MetaTagsController.new } context 'module' do it 'should be mixed into ActionController::Base' do expect(ActionController::Base.included_modules).to include(MetaTags::ControllerHelper) end it 'should respond to "set_meta_tags" helper' do expect(subject).to respond_to(:set_meta_tags) end end describe '.render' do it 'should set meta tags from instance variables' do subject.index expect(subject.rendered).to be_truthy expect(subject.meta_tags.meta_tags).to eq('title' => 'title', 'keywords' => 'key1, key2, key3', 'description' => 'description') end end it_behaves_like '.set_meta_tags' end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
meta_tags-rails-1.1.1 | spec/controller_helper_spec.rb |
meta_tags-rails-1.1.0 | spec/controller_helper_spec.rb |