This file contains hidden or 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
class SectionsController < ApplicationController | |
load_and_authorize_resource | |
expose(:section) | |
expose(:sections) { search.paginate(:page => params[:page]) } | |
expose(:search) { Section.search(params[:search]) } | |
def create | |
if section.save |
This file contains hidden or 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
require 'spec_helper' | |
describe User do | |
describe "other_users" do | |
before { | |
User.delete_all | |
@me = Factory(:user) | |
@other_one = Factory(:user) | |
@other_two = Factory(:user) |
This file contains hidden or 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
describe User do | |
describe "other_users"do | |
it "should return other users" do | |
User.delete_all | |
me = Factory(:user) | |
other_one = Factory(:user) | |
other_two = Factory(:user) | |
User.other_users(me).all.should_not be_empty |
NewerOlder