Permalink
Browse files

Rolled back all specs (due to the rollback of machinist)

  • Loading branch information...
1 parent 91d46ea commit 8e3c17fa8aff51d17040efa160dfc7504f1d2653 @juan-hawa-intellisys juan-hawa-intellisys committed May 16, 2011
View
71 Gemfile
@@ -1,48 +1,47 @@
-source :rubygems
+gem "rails", "3.0.7"
-gem 'rails', '3.0.7'
-
-gem 'acts_as_list'
+source 'http://rubygems.org'
+gem 'daemons', '1.1.0'
+gem 'will_paginate', '>=3.0pre2'
+gem 'icalendar', '>=1.1.5'
+gem 'tzinfo'
+gem 'RedCloth', '>=4.2.4.pre3', :require=>'redcloth'
+gem 'gchartrb', '>=0.8', :require=>"google_chart"
+gem 'smurf'
+gem 'paperclip', '>=2.3.3'
+gem 'json'
+gem 'mysql2', '<0.3' # version 0.3 of mysql2 requires Rails 3.1
gem 'acts_as_tree'
-gem 'daemons', '1.1.0'
-gem 'devise', '1.1.9'
+gem 'acts_as_list'
gem 'dynamic_form'
-gem 'exception_notification_rails3', :require => 'exception_notifier'
-gem 'faker'
-gem 'gchartrb', '>=0.8', :require=>"google_chart"
-gem 'icalendar', '>=1.1.5'
-gem 'json'
-gem 'machinist', '1.0.6'
-gem 'mysql2', '<0.3' # version 0.3 of mysql2 requires Rails 3.1
-gem 'net-ldap'
-gem 'paperclip', '>=2.3.3'
-gem 'RedCloth', '>=4.2.4.pre3', :require=>'redcloth'
gem 'remotipart'
-gem 'rufus-scheduler'
+gem "exception_notification_rails3", :require => "exception_notifier"
+gem "rufus-scheduler"
+gem 'net-ldap'
+gem 'devise', '1.1.9'
gem 'sass'
-gem 'smurf'
-gem 'tzinfo'
-gem 'will_paginate', '>=3.0pre2'
group :test do
- gem 'autotest'
- gem 'autotest-rails-pure'
- gem 'capybara', '=0.4.0'
- gem 'cucumber', '>=0.8.5'
- gem 'cucumber-rails', '>=0.3.2'
- gem 'database_cleaner', '>=0.6.0'
- gem 'rspec'
- gem 'rspec-rails', '>=2.0.0'
- gem 'shoulda', '>=2.11.3'
- gem 'spork'
+ gem "shoulda", '>=2.11.3'
+ gem "rspec"
+ gem "rspec-rails", '>=2.0.0'
+ gem "faker", '0.3.1'
+ gem "ZenTest"
+ gem "autotest"
+ gem "autotest-rails"
+ gem "cucumber", '>=0.8.5'
+ gem "database_cleaner", '>=0.6.0'
+ gem "cucumber-rails", '>=0.3.2'
+ gem "capybara", '=0.4.0'
+ gem "ruby-prof"
+ gem "launchy"
gem 'test-unit'
+ gem "machinist", '1.0.6'
+ gem "ci_reporter"
+ gem "simplecov"
end
group :development do
- gem 'annotate'
- gem 'ci_reporter'
- gem 'launchy'
- gem 'ruby-prof'
- gem 'simplecov'
- gem 'sqlite3'
+# gem "bullet"
+ gem "annotate"
end
View
@@ -36,7 +36,8 @@ GEM
arel (2.0.9)
autotest (4.4.6)
ZenTest (>= 4.4.1)
- autotest-rails-pure (4.1.2)
+ autotest-rails (4.1.0)
+ ZenTest
bcrypt-ruby (2.1.4)
builder (2.1.2)
capybara (0.4.0)
@@ -150,8 +151,6 @@ GEM
simplecov-html (~> 0.4.4)
simplecov-html (0.4.4)
smurf (1.0.6)
- spork (0.8.4)
- sqlite3 (1.3.3)
term-ansicolor (1.0.5)
test-unit (2.3.0)
thor (0.14.6)
@@ -169,11 +168,12 @@ PLATFORMS
DEPENDENCIES
RedCloth (>= 4.2.4.pre3)
+ ZenTest
acts_as_list
acts_as_tree
annotate
autotest
- autotest-rails-pure
+ autotest-rails
capybara (= 0.4.0)
ci_reporter
cucumber (>= 0.8.5)
@@ -183,7 +183,7 @@ DEPENDENCIES
devise (= 1.1.9)
dynamic_form
exception_notification_rails3
- faker
+ faker (= 0.3.1)
gchartrb (>= 0.8)
icalendar (>= 1.1.5)
json
@@ -202,8 +202,6 @@ DEPENDENCIES
shoulda (>= 2.11.3)
simplecov
smurf
- spork
- sqlite3
test-unit
tzinfo
will_paginate (>= 3.0pre2)
View
@@ -43,7 +43,6 @@ class EventLog < ActiveRecord::Base
RESOURCE_PASSWORD_REQUESTED = 70
RESOURCE_CHANGE = 71
- FORUM_NEW_POST = 72
scope :accessed_by, lambda { |user|
where("event_logs.company_id = ? AND (event_logs.project_id IN (?) OR event_logs.project_id IS NULL) AND if(target_type='WorkLog', (select work_logs.id from work_logs join project_permissions on work_logs.project_id = project_permissions.project_id and project_permissions.user_id= ? where work_logs.id=event_logs.target_id and work_logs.access_level_id <= ? and (project_permissions.can_see_unwatched=? or ? in (select task_users.user_id from task_users where task_users.task_id=work_logs.task_id))) , true) ", user.company_id, user.project_ids, true, user.id, user.access_level_id, user.id)
View
@@ -2,20 +2,45 @@
require 'rails/all'
+# If you have a Gemfile, require the gems listed there, including any gems
+# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Jobsworth
class Application < Rails::Application
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+
+ # Add additional load paths for your own custom dirs
+ # config.load_paths += %W( #{config.root}/extras )
+
+ # Only load the plugins named here, in the order given (default is alphabetical).
+ # :all can be used as a placeholder for all plugins not explicitly named
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
+
+ # Activate observers that should always be running
+ # config.active_record.observers = :cacher, :garbage_collector
+
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+ # config.time_zone = 'Central Time (US & Canada)'
+
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+ # config.i18n.default_locale = :de
+
+ # Configure generators values. Many other options are available, be sure to check the documentation.
+ # config.generators do |g|
+ # g.orm :active_record
+ # g.template_engine :erb
+ # g.test_framework :test_unit, :fixture => true
+ # end
+
+ # Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
+
+ # Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
- config.generators do |g|
- g.fixture_replacement :machinist
- end
-
- if Rails.env.test?
- initializer :after => :initialize_dependency_mechanism do
- ActiveSupport::Dependencies.mechanism = :load
- end
- end
end
end
@@ -1,21 +1,10 @@
require 'spec_helper'
describe ScmChangesetsController do
-
- before(:each) do
- @user ||= User.make!
- sign_in @user
- end
-
- describe "POST 'create'" do
-
+ describe "POST create" do
context "with valid params" do
-
before(:each) do
- ScmChangeset.should_receive(:create_from_web_hook).
- with("scm_changeset"=>{ 'these'=> :params }, "action"=>"create",
- "controller"=>"scm_changesets").
- and_return(mock_model(ScmChangeset))
+ ScmChangeset.should_receive(:create_from_web_hook).with("scm_changeset"=>{ 'these'=> :params }, "action"=>"create", "controller"=>"scm_changesets").and_return(mock_model(ScmChangeset))
post :create, :scm_changeset=>{ :these=> :params }
end
it "respond with HTTP-STATUS: 201 CREATED" do
@@ -1,79 +1,55 @@
require 'spec_helper'
-
describe ScmProjectsController do
-
before(:each) do
- @scm_project= mock_model(ScmProject)
+ @scm_project= mock_model(ScmProject)
end
-
- describe "GET 'new'" do
- it "should render the right template" do
- user = User.make!(:admin => 1)
- sign_in user
+ describe "GET new" do
+ it "should render new template" do
+ login_user( 'admin?' => true )
+ ScmProject.should_receive(:new).and_return(@scm_project)
get :new
response.should render_template('scm_projects/new')
end
-
it "should redirect to last url, if user not have create project permission" do
- user = User.make!(:admin => 0)
- sign_in user
+ login_user('admin?' => false )
get :new
response.should be_redirect
end
end
-
describe "POST create" do
-
context "user with admin permission" do
-
before(:each) do
- @user = User.make!(:admin => 1)
- sign_in @user
+ login_user( 'admin?' => true, "company"=> 1)
end
-
context "with valiad params" do
-
before(:each) do
- ScmProject.should_receive(:new).
- with('these' => 'params').
- and_return(@scm_project = mock_model(ScmProject, { :save=>true}))
- @scm_project.should_receive("company=").with(@user.company)
+ ScmProject.should_receive(:new).with('these' => 'params').and_return(@scm_project = mock_model(ScmProject, { :save=>true}))
+ @scm_project.should_receive("company=").with(1)
+ post :create, :scm_project => { :these=>'params'}
end
-
it "should redirect to show action" do
- post :create, :scm_project => { :these => 'params'}
response.should redirect_to(scm_project_url(@scm_project))
end
end
-
context "with invalid params" do
-
before(:each) do
- ScmProject.should_receive(:new).
- with('these'=>'params').
- and_return(@scm_project = mock_model(ScmProject,{ :save=>false}))
- @scm_project.should_receive("company=").with(@user.company)
+ ScmProject.should_receive(:new).with('these'=>'params').and_return(@scm_project = mock_model(ScmProject,{ :save=>false}))
+ @scm_project.should_receive("company=").with(1)
+ post :create,:scm_project => { :these=>'params'}
end
-
it "should render new template" do
- post :create,:scm_project => { :these =>'params'}
response.should render_template('scm_projects/new')
end
end
end
-
context "user without admin permission" do
-
before(:each) do
- user = User.make!(:admin => 0)
- sign_in user
+ login_user('admin?' => false )
+ post :create, :scm_project => { :these=>'params' }
end
-
it "should redirect to last" do
- post :create, :scm_project => { :these=>'params' }
response.should be_redirect
end
-
it "should not create scm project" do
ScmProject.should_not_receive(:new)
end
Oops, something went wrong.

0 comments on commit 8e3c17f

Please sign in to comment.