forked from refinery/refinerycms
-
Notifications
You must be signed in to change notification settings - Fork 12
/
activity_spec.rb
44 lines (38 loc) · 961 Bytes
/
activity_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
require "spec_helper"
describe Refinery::Activity do
before do
module Y
module Y
class Z
end
end
end
@activity = Refinery::Activity.new(:class_name => "Y::Y::Z")
end
describe "#base_class_name" do
it "should return the base class name, less module nesting" do
@activity.base_class_name.should == "Z"
end
end
describe "#klass" do
it "returns class constant" do
@activity.klass.should == Y::Y::Z
end
end
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_"
end
end
describe "#url" do
it "should return the url" do
@activity.url.should == "edit_refinery_admin_z_path"
end
end
end