Skip to content

Commit

Permalink
all tests clean and gem packageable.
Browse files Browse the repository at this point in the history
Many small fixes. mostly to address minor inconsistencies. user_params moved into users_dataset. references_helper_spec sets params[:type] instead of params[Id}. All very straightforward, I hope.
  • Loading branch information
will-r committed Jan 25, 2010
1 parent 9142e9f commit 0b84430
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion features/admin/user_preferences.feature
Expand Up @@ -15,4 +15,4 @@ Feature: Edit user preferences
| another |
| existing |
| designer |
| non-admin |
| non_admin |
2 changes: 1 addition & 1 deletion lib/radiant/admin_ui.rb
Expand Up @@ -116,7 +116,7 @@ def nav_item(*args)
end

def tabs
nav
nav['Content']
end

# Region sets
Expand Down
12 changes: 11 additions & 1 deletion spec/datasets/users_dataset.rb
Expand Up @@ -5,7 +5,7 @@ def load
create_user "Another"
create_user "Admin", :admin => true
create_user "Designer", :designer => true
create_user "Non-admin", :admin => false
create_user "Non_admin", :admin => false
end

helpers do
Expand All @@ -32,6 +32,16 @@ def user_attributes(attributes={})
attributes
end

def user_params(options = {})
{
:name => 'John Doe',
:login => 'jdoe',
:password => 'password',
:password_confirmation => 'password',
:email => 'jdoe@gmail.com'
}.merge(options)
end

def login_as(user)
login_user = user.is_a?(User) ? user : users(user)
flunk "Can't login as non-existing user #{user.to_s}." unless login_user
Expand Down
8 changes: 4 additions & 4 deletions spec/helpers/admin/references_helper_spec.rb
Expand Up @@ -45,7 +45,7 @@
describe "when getting a filter reference" do
before :each do
helper.send(:instance_variable_set, :@filter, nil)
params[:id] = 'filters'
params[:type] = 'filters'
end

it "should return the name of the set filter" do
Expand All @@ -62,7 +62,7 @@
describe "when getting a tag reference" do
before :each do
helper.send(:instance_variable_set, :@page_class, nil)
params[:id] = 'tags'
params[:type] = 'tags'
end

it "should return the display name of the page class" do
Expand All @@ -80,7 +80,7 @@
describe "rendering the filter reference" do
before :each do
helper.send(:instance_variable_set, :@filter, nil)
params[:id] = 'filters'
params[:type] = 'filters'
params[:filter_name] = 'Textile'
end

Expand All @@ -102,7 +102,7 @@
describe "rendering the tag reference" do
before :each do
helper.send(:instance_variable_set, :@page_class, nil)
params[:id] = 'tags'
params[:type] = 'tags'
params[:class_name] = ''
end

Expand Down

0 comments on commit 0b84430

Please sign in to comment.