diff --git a/Gemfile.lock b/Gemfile.lock index d515369..9802b51 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - tandem (0.2.3) + tandem (0.2.4) cancan (= 1.6.7) eco paperclip @@ -11,32 +11,32 @@ PATH GEM remote: http://rubygems.org/ specs: - actionmailer (3.2.8) - actionpack (= 3.2.8) - mail (~> 2.4.4) - actionpack (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) + actionmailer (3.2.13) + actionpack (= 3.2.13) + mail (~> 2.5.3) + actionpack (3.2.13) + activemodel (= 3.2.13) + activesupport (= 3.2.13) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) - rack (~> 1.4.0) + rack (~> 1.4.5) rack-cache (~> 1.2) rack-test (~> 0.6.1) - sprockets (~> 2.1.3) - activemodel (3.2.8) - activesupport (= 3.2.8) + sprockets (~> 2.2.1) + activemodel (3.2.13) + activesupport (= 3.2.13) builder (~> 3.0.0) - activerecord (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) + activerecord (3.2.13) + activemodel (= 3.2.13) + activesupport (= 3.2.13) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activeresource (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) - activesupport (3.2.8) - i18n (~> 0.6) + activeresource (3.2.13) + activemodel (= 3.2.13) + activesupport (= 3.2.13) + activesupport (3.2.13) + i18n (= 0.6.1) multi_json (~> 1.0) addressable (2.2.7) archive-tar-minitar (0.5.2) @@ -44,18 +44,18 @@ GEM bcrypt-ruby (3.0.1) builder (3.0.4) cancan (1.6.7) - capybara (1.1.2) + capybara (2.0.3) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) selenium-webdriver (~> 2.0) - xpath (~> 0.1.4) - capybara-webkit (0.10.1) - capybara (>= 1.0.0, < 1.2) + xpath (~> 1.0.0) + capybara-webkit (0.14.2) + capybara (~> 2.0, >= 2.0.2) json - childprocess (0.3.1) - ffi (~> 1.0.6) + childprocess (0.3.9) + ffi (~> 1.0, >= 1.0.11) cocaine (0.2.1) coderay (1.0.5) coffee-rails (3.2.2) @@ -71,7 +71,7 @@ GEM bcrypt-ruby (~> 3.0) orm_adapter (~> 0.0.3) warden (~> 1.1) - diff-lcs (1.1.3) + diff-lcs (1.2.1) eco (1.0.0) coffee-script eco-source @@ -89,7 +89,7 @@ GEM factory_girl_rails (4.1.0) factory_girl (~> 4.1.0) railties (>= 3.0.0) - ffi (1.0.11) + ffi (1.6.0) growl_notify (0.0.3) rb-appscript guard (1.4.0) @@ -99,8 +99,9 @@ GEM em-websocket (>= 0.2.0) guard (>= 0.10.0) multi_json (~> 1.0) - guard-rspec (1.2.1) + guard-rspec (2.5.1) guard (>= 1.1) + rspec (~> 2.11) guard-spork (0.3.2) guard (>= 0.8.4) spork (>= 0.8.4) @@ -116,20 +117,20 @@ GEM jquery-rails (1.0.18) railties (~> 3.0) thor (~> 0.14) - json (1.7.5) + json (1.7.7) launchy (2.0.5) addressable (~> 2.2.6) linecache19 (0.5.12) ruby_core_source (>= 0.1.4) - listen (0.5.3) - mail (2.4.4) + listen (0.7.3) + mail (2.5.3) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) method_source (0.7.0) - mime-types (1.19) - multi_json (1.3.6) - nokogiri (1.5.0) + mime-types (1.21) + multi_json (1.7.2) + nokogiri (1.5.9) orm_adapter (0.0.5) paperclip (2.6.0) activerecord (>= 2.3.0) @@ -142,50 +143,52 @@ GEM coderay (~> 1.0.5) method_source (~> 0.7) slop (>= 2.4.3, < 3) - rack (1.4.1) + rack (1.4.5) rack-cache (1.2) rack (>= 0.4) - rack-ssl (1.3.2) + rack-ssl (1.3.3) rack rack-test (0.6.2) rack (>= 1.0) - rails (3.2.8) - actionmailer (= 3.2.8) - actionpack (= 3.2.8) - activerecord (= 3.2.8) - activeresource (= 3.2.8) - activesupport (= 3.2.8) + rails (3.2.13) + actionmailer (= 3.2.13) + actionpack (= 3.2.13) + activerecord (= 3.2.13) + activeresource (= 3.2.13) + activesupport (= 3.2.13) bundler (~> 1.0) - railties (= 3.2.8) - railties (3.2.8) - actionpack (= 3.2.8) - activesupport (= 3.2.8) + railties (= 3.2.13) + railties (3.2.13) + actionpack (= 3.2.13) + activesupport (= 3.2.13) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - rake (0.9.2.2) + rake (10.0.4) rb-appscript (0.6.1) rb-fchange (0.0.5) ffi rb-fsevent (0.9.0) rb-inotify (0.8.8) ffi (>= 0.5.0) - rdoc (3.12) + rdoc (3.12.2) json (~> 1.4) - rspec (2.11.0) - rspec-core (~> 2.11.0) - rspec-expectations (~> 2.11.0) - rspec-mocks (~> 2.11.0) - rspec-core (2.11.1) - rspec-expectations (2.11.3) - diff-lcs (~> 1.1.3) - rspec-mocks (2.11.3) - rspec-rails (2.11.4) + rspec (2.13.0) + rspec-core (~> 2.13.0) + rspec-expectations (~> 2.13.0) + rspec-mocks (~> 2.13.0) + rspec-core (2.13.1) + rspec-expectations (2.13.0) + diff-lcs (>= 1.1.3, < 2.0) + rspec-mocks (2.13.0) + rspec-rails (2.13.0) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) - rspec (~> 2.11.0) + rspec-core (~> 2.13.0) + rspec-expectations (~> 2.13.0) + rspec-mocks (~> 2.13.0) ruby-debug-base19 (0.11.25) columnize (>= 0.3.1) linecache19 (>= 0.5.11) @@ -196,17 +199,17 @@ GEM ruby-debug-base19 (>= 0.11.19) ruby_core_source (0.1.5) archive-tar-minitar (>= 0.5.2) - rubyzip (0.9.6.1) - sass (3.1.15) - sass-rails (3.2.5) + rubyzip (0.9.9) + sass (3.2.7) + sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) - selenium-webdriver (2.20.0) + selenium-webdriver (2.31.0) childprocess (>= 0.2.5) - ffi (~> 1.0) multi_json (~> 1.0) rubyzip + websocket (~> 1.0.4) slim (1.0.4) temple (~> 0.3.4) tilt (~> 1.3.2) @@ -217,23 +220,25 @@ GEM slim (~> 1.0) slop (2.4.3) spork (0.9.0) - sprockets (2.1.3) + sprockets (2.2.2) hike (~> 1.2) + multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) temple (0.3.4) - thor (0.16.0) - tilt (1.3.3) + thor (0.18.0) + tilt (1.3.6) treetop (1.4.12) polyglot polyglot (>= 0.3.1) - tzinfo (0.3.34) + tzinfo (0.3.37) uglifier (1.2.3) execjs (>= 0.3.0) multi_json (>= 1.0.2) warden (1.1.0) rack (>= 1.0) - xpath (0.1.4) + websocket (1.0.7) + xpath (1.0.0) nokogiri (~> 1.3) PLATFORMS diff --git a/History.rdoc b/History.rdoc index 6706ae8..8ce7115 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,9 @@ +0.2.5 + * Feature - As a developer, I should be able to specify the html tag I want my tandem tag wrapped in, so I have more control over the generated markup. + +0.2.4 - January 3rd, 2013 + * Feature - A user should be able to embed Youtube videos to a page + 0.2.3 - August 9th, 2012 * Bug - Options passed to a main_app url_helper from within tandem get passed as an array * Feature - CSS specification overhaul to have tandem styles override any exisiting website styles when Tandem UI is being used diff --git a/README.rdoc b/README.rdoc index 1b43811..02cd759 100644 --- a/README.rdoc +++ b/README.rdoc @@ -92,6 +92,11 @@ you can set the editor option to :wysiwyg: <%= tandem_text_tag(:sidebar_text, editor: :wysiwyg) %> +By default, tandem wraps content in a div tag. If you'd prefer a different tag, simply +specify it with the tag option. + + <%= tandem_text_tag(:sidebar_text, tag: :h1) %> + === Navigation Tandem comes with a helper method to add a navigation menu. It's not included in the default diff --git a/app/helpers/tandem/pages_helper.rb b/app/helpers/tandem/pages_helper.rb index 4386e54..eb2ea1a 100644 --- a/app/helpers/tandem/pages_helper.rb +++ b/app/helpers/tandem/pages_helper.rb @@ -85,13 +85,14 @@ def self.included(base) # <%= tandem_content_tag(:main_body, :text, editor: :wysiwyg) %> def tandem_content_tag(identifier, type, options = {}, html_options = {}) options[:editor] ||= :plain + options[:tag] ||= :div using_tandem_abilities do tandem_content = Content.scoped_type(type).constantize.find_or_create_by_request_key_and_tag(request_key, identifier) content = case tandem_content when Content::Text - content_tag(:div, tandem_content, options.merge( + content_tag(options[:tag], tandem_content, options.merge( id: "#{dom_class(tandem_content)}_#{identifier}", class: "#{dom_class(tandem_content)} #{options[:class]}".strip )) { diff --git a/spec/dummy/app/views/layouts/application.html.erb b/spec/dummy/app/views/layouts/application.html.erb index 917eb2a..9d51951 100644 --- a/spec/dummy/app/views/layouts/application.html.erb +++ b/spec/dummy/app/views/layouts/application.html.erb @@ -9,7 +9,6 @@ <%= tandem_navigation_tag(@page) %> - <%= tandem_page_links %> <%= yield %> diff --git a/spec/requests/contents_spec.rb b/spec/features/contents_spec.rb similarity index 96% rename from spec/requests/contents_spec.rb rename to spec/features/contents_spec.rb index ab1d847..0b161d1 100644 --- a/spec/requests/contents_spec.rb +++ b/spec/features/contents_spec.rb @@ -18,7 +18,7 @@ describe "Tandem Content on non-tandem pages" do describe "get /widgets" do it "renders the widgets index and creates a tandem content items" do - get '/widgets' + visit '/widgets' end end end diff --git a/spec/requests/pages_spec.rb b/spec/features/pages_spec.rb similarity index 97% rename from spec/requests/pages_spec.rb rename to spec/features/pages_spec.rb index 5a08813..8448e3d 100644 --- a/spec/requests/pages_spec.rb +++ b/spec/features/pages_spec.rb @@ -9,7 +9,7 @@ describe "get /tandem" do it "renders the home page" do - get '/tandem' + visit '/tandem' end end diff --git a/spec/requests/users_spec.rb b/spec/features/users_spec.rb similarity index 100% rename from spec/requests/users_spec.rb rename to spec/features/users_spec.rb diff --git a/spec/helpers/tandem/pages_helper_spec.rb b/spec/helpers/tandem/pages_helper_spec.rb index 0349e93..1b354ad 100644 --- a/spec/helpers/tandem/pages_helper_spec.rb +++ b/spec/helpers/tandem/pages_helper_spec.rb @@ -56,6 +56,20 @@ module Tandem it { should =~ /id="tandem_content_link_#{content.tag}"/ } end + + describe 'the content tag' do + it 'should default to using a div' do + subject.should have_selector('div') + end + + context 'when specifying a tag' do + subject { helper.tandem_content_tag(content.tag, :text, tag: :h1) } + + it 'should use the tag specified in the options hash' do + subject.should have_selector("h1#content_text_#{content.tag}") + end + end + end end context "for a user who can edit content" do diff --git a/spec/routing/tandem/contents_routing_spec.rb b/spec/routing/tandem/contents_routing_spec.rb index 447e086..4e35afe 100644 --- a/spec/routing/tandem/contents_routing_spec.rb +++ b/spec/routing/tandem/contents_routing_spec.rb @@ -2,7 +2,7 @@ module Tandem require "spec_helper" describe ContentsController do - before(:each) { @routes = Engine.routes } + before(:each) { assertion_instance.instance_variable_set(:@routes, Engine.routes) } describe "routing" do diff --git a/spec/routing/tandem/images_routing_spec.rb b/spec/routing/tandem/images_routing_spec.rb index 99f81e0..21c9c35 100644 --- a/spec/routing/tandem/images_routing_spec.rb +++ b/spec/routing/tandem/images_routing_spec.rb @@ -2,7 +2,7 @@ module Tandem require "spec_helper" describe ImagesController do - before(:each) { @routes = Engine.routes } + before(:each) { assertion_instance.instance_variable_set(:@routes, Engine.routes) } describe "routing" do @@ -40,4 +40,4 @@ module Tandem end end -end \ No newline at end of file +end diff --git a/spec/routing/tandem/pages_routing_spec.rb b/spec/routing/tandem/pages_routing_spec.rb index 48ca002..0cb9421 100644 --- a/spec/routing/tandem/pages_routing_spec.rb +++ b/spec/routing/tandem/pages_routing_spec.rb @@ -2,8 +2,9 @@ module Tandem require "spec_helper" describe PagesController do - #http://stackoverflow.com/questions/7691594/how-to-test-routes-in-a-rails-3-1-mountable-engine - before(:each) { @routes = Engine.routes } + # Will update after rspec-rails 2.14 is released + # https://github.com/rspec/rspec-rails/pull/668#issuecomment-13997339 + before(:each) { assertion_instance.instance_variable_set(:@routes, Engine.routes) } describe "routing" do @@ -41,4 +42,4 @@ module Tandem end end -end \ No newline at end of file +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3925ab1..7d8f000 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -80,8 +80,6 @@ # rspec-rails. config.infer_base_class_for_anonymous_controllers = false - config.include Capybara, :example_group => { :file_path => /\bspec\/integration\// } - config.include Tandem::Engine.routes.url_helpers config.include Tandem::ControllerRequests, :type => :controller