-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This works by allowing refinery.url_for(Refinery.route_for_model(result.class, :admin => false)) to be used in place of refinery.url_for(result)
- Loading branch information
Showing
5 changed files
with
96 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,46 @@ | ||
require "spec_helper" | ||
require 'spec_helper' | ||
|
||
describe Refinery::Activity do | ||
before { module X; module Y; class Z; end; end; end } | ||
|
||
let(:activity) { Refinery::Activity.new(:class_name => "X::Y::Z") } | ||
let(:activity) { Refinery::Activity.new(:class_name => 'X::Y::Z') } | ||
|
||
describe "#base_class_name" do | ||
it "should return the base class name, less module nesting" do | ||
activity.base_class_name.should == "Z" | ||
describe '#base_class_name' do | ||
it 'returns the base class name, less module nesting' do | ||
activity.base_class_name.should == 'Z' | ||
end | ||
end | ||
|
||
describe "#klass" do | ||
it "returns class constant" do | ||
describe '#klass' do | ||
it 'returns class constant' do | ||
activity.klass.should == X::Y::Z | ||
end | ||
end | ||
|
||
describe "#url_prefix" do | ||
it "returns edit_ by default" do | ||
activity.url_prefix.should == "edit_" | ||
describe '#url_prefix' do | ||
it 'returns edit_ by default' do | ||
activity.url_prefix.should == 'edit_' | ||
end | ||
|
||
it "returns user specified prefix" do | ||
activity.url_prefix = "testy" | ||
activity.url_prefix.should == "testy_" | ||
activity.url_prefix = "testy_" | ||
activity.url_prefix.should == "testy_" | ||
it 'returns user specified prefix' do | ||
activity.url_prefix = 'testy' | ||
activity.url_prefix.should == 'testy_' | ||
activity.url_prefix = 'testy_' | ||
activity.url_prefix.should == 'testy_' | ||
end | ||
end | ||
|
||
describe "#url" do | ||
it "should return the url" do | ||
activity.url.should == "refinery.edit_y_admin_z_path" | ||
describe '#url' do | ||
it 'returns the url' do | ||
activity.url.should == 'refinery.edit_x_y_admin_z_path' | ||
end | ||
end | ||
|
||
describe '#url with Refinery namespace' do | ||
before { module Refinery; module Y; class Z; end; end; end } | ||
let(:activity) { Refinery::Activity.new(:class_name => 'Refinery::Y::Z') } | ||
it 'returns the url' do | ||
activity.url.should == 'refinery.edit_y_admin_z_path' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters