Skip to content

Instantly share code, notes, and snippets.

View creich's full-sized avatar

Christian Reich creich

  • Dresden / Germany
View GitHub Profile
class OverviewController < ApplicationController
def index
@server_list = Factory::server_list
@groups_by_server = Factory::groups_by_server
end
end
require 'test_helper'
class OverviewControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
end
end
class EventList < ActiveRecord::Base
self.table_name = "event_list"
attr_accessible :alarm_id, :code, :data, :event_time, :reference_id
belongs_to :device_alarm, :foreign_key => "alarm_id"
end
PS > rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
C:/Ruby193/bin/ruby.exe C:/Ruby193/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
C:\Ruby193\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:\Ruby193\bin\rake assets:precompile[--trace]
C:/Ruby193/bin/ruby.exe C:\Ruby193\bin\rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
(in app/assets/javascripts/application.js)
Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [C:/Ruby193/bin/ruby.exe C:\Ruby193\bin\rak...]
-e:1:in `load'
t = Test.new
t.foo = "new value"
t.changed? # <== this one should be true!
# t.changed should be like ['foo']
def update(tl)
time_log = TimeLog.where(:id => tl[:id]).first
start = Time.parse(tl[:tt_log_date] + " " + tl[:start_time])
hours = time_string2hour(tl[:spent_time])
stop = start + hours.hours
time_log.update_attributes!(:started_on => start, :stopped_at => stop, :comments => tl[:comments])
flash[:notice] = l(:tt_update_log_success)
rescue StandardError => e
flash[:error] = e.message
context "with :tt_log_time permission only" do
setup do
Role.find(2).add_permission! :tt_log_time
end
should "update only TT -comments and -round on own trackers" do
put :update, {:time_tracker => {:comments => "new comment"}}
assert_response :success
tt = TimeTracker.where(:id => 1).first
assert_equal("new comment", tt.comments, "updated TT-comment")
should "stop a TT correctly" do
assert_difference 'TimeTracker.count', -1 do
get :stop, {}, {"HTTP_REFERER" => "where_i_came_from"}
end
end
C:\Ruby193\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:\Ruby193\bin\rake redmine:plugins:test
Testing started at 12:16 ...
C:/Ruby193/bin/ruby.exe -I"lib;test" -I"C:/Ruby193/lib/ruby/1.9.1" "C:/Ruby193/lib/ruby/1.9.1/rake/rake_test_loader.rb" "plugins/redmine_time_tracker/test/unit/time_tracker_test.rb"
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require': iconv will be deprecated in the future, use String#encode instead.
Run options:
# Running tests:
E