# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#require 'shoulda'
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'rails/test_help'
class ActiveSupport::TestCase
include ActionDispatch::TestProcess
- include Shoulda::Context::Assertions
- include Shoulda::Context::InstanceMethods
- extend Shoulda::Context::ClassMethods
self.use_transactional_fixtures = true
self.use_instantiated_fixtures = false
)
end
user = User.order('id DESC').first
- assert_same_elements [group1, group2], user.groups
+ assert_equal [group1, group2].sort, user.groups.sort
end
def test_created_user_should_not_receive_account_information_with_no_account_info_option
project = Project.generate!
parent_version_1 = Version.generate!(:project => project)
parent_version_2 = Version.generate!(:project => project)
- assert_same_elements [parent_version_1, parent_version_2], project.rolled_up_versions
+ assert_equal [parent_version_1, parent_version_2].sort,
+ project.rolled_up_versions.sort
end
test "#rolled_up_versions should include versions for a subproject" do
subproject = Project.generate_with_parent!(project)
subproject_version = Version.generate!(:project => subproject)
- assert_same_elements [
- parent_version_1,
- parent_version_2,
- subproject_version
- ], project.rolled_up_versions
+ assert_equal [parent_version_1, parent_version_2, subproject_version].sort,
+ project.rolled_up_versions.sort
end
test "#rolled_up_versions should include versions for a sub-subproject" do
sub_subproject_version = Version.generate!(:project => sub_subproject)
project.reload
- assert_same_elements [
- parent_version_1,
- parent_version_2,
- sub_subproject_version
- ], project.rolled_up_versions
+ assert_equal [parent_version_1, parent_version_2, sub_subproject_version].sort,
+ project.rolled_up_versions.sort
end
test "#rolled_up_versions should only check active projects" do
project.reload
assert !subproject.active?
- assert_same_elements [parent_version_1, parent_version_2], project.rolled_up_versions
+ assert_equal [parent_version_1, parent_version_2].sort,
+ project.rolled_up_versions.sort
end
def test_shared_versions_none_sharing