Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'release/v0.1.4'

  • Loading branch information...
commit 0c87968ba0c6682cf0e9b58129eac4b29e9689ca 2 parents f748c31 + 7b8cea6
Ramon Tayag authored
6 Gemfile.lock
View
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- navi (0.1.0)
+ navi (0.1.3)
activerecord (>= 3.0.0)
activesupport (>= 3.0.0)
ordered_tree (>= 0.1.6)
@@ -71,7 +71,7 @@ GEM
database_cleaner (0.7.1)
diff-lcs (1.1.3)
erubis (2.7.0)
- factory_girl (2.1.2)
+ factory_girl (2.5.1)
activesupport
ffi (1.0.11)
gherkin (2.4.21)
@@ -197,7 +197,7 @@ DEPENDENCIES
cucumber
cucumber-rails (= 0.5.2)
database_cleaner
- factory_girl (~> 2.1.0)
+ factory_girl (~> 2.5.1)
guard-cucumber (= 0.3.4)
guard-rspec
haml
8 lib/navi/navigable/instance_methods.rb
View
@@ -26,9 +26,11 @@ def navigator_instance
end
def prepare_standalone_navigator!
- set_navigator_label_to_self!
- set_navigator_url_to_hash!
- nullify_navigator_pointer_to_self!
+ if navigator_instance
+ set_navigator_label_to_self!
+ set_navigator_url_to_hash!
+ nullify_navigator_pointer_to_self!
+ end
end
def set_navigator_label_to_self!
2  lib/navi/version.rb
View
@@ -1,3 +1,3 @@
module Navi
- VERSION = "0.1.3"
+ VERSION = "0.1.4"
end
3  navi.gemspec
View
@@ -46,7 +46,6 @@ Gem::Specification.new do |s|
s.add_development_dependency 'libnotify'
s.add_development_dependency 'rb-inotify'
s.add_development_dependency 'nifty-generators'
- s.add_development_dependency 'factory_girl', '~> 2.1.0'
- #s.add_development_dependency 'factory_girl_rails', '~> 1.2'
+ s.add_development_dependency 'factory_girl', '~> 2.5.1'
s.add_development_dependency 'ruby-debug19'
end
38 spec/navi/navigable_spec.rb
View
@@ -2,22 +2,34 @@
describe "Navigable" do
context "when deleted" do
- before do
- page = Factory :page, :name => "Page name"
- @menu_item = page.to_navigator!
- page.destroy
- @menu_item.reload
- end
+ context "and the navigator has a navigable item" do
+ before do
+ page = Factory :page, :name => "Page name"
+ @menu_item = page.to_navigator!
+ page.destroy
+ @menu_item.reload
+ end
+
+ it "should nullify the navigator's (menu item) pointer to itself" do
+ @menu_item.navigable.should be_nil
+ @menu_item.navigable_id.should be_nil
+ @menu_item.navigable_type.should be_nil
+ end
- it "should nullify the navigator's (menu item) pointer to itself" do
- @menu_item.navigable.should be_nil
- @menu_item.navigable_id.should be_nil
- @menu_item.navigable_type.should be_nil
+ it "should set the label and url" do
+ @menu_item.label.should == "Page name"
+ @menu_item.url.should == "#"
+ end
end
- it "should set the label and url" do
- @menu_item.label.should == "Page name"
- @menu_item.url.should == "#"
+ context "and the navigable has no navigator item" do
+ before do
+ @page = Factory :page, :name => "Page name"
+ end
+
+ it "should not blow up" do
+ expect {@page.destroy}.to_not raise_error
+ end
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.