This file contains 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
should "stop a TT correctly" do | |
assert_difference 'TimeTracker.count', -1 do | |
get :stop, {}, {"HTTP_REFERER" => "where_i_came_from"} | |
end | |
end |
This file contains 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
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") |
This file contains 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
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 |
This file contains 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
t = Test.new | |
t.foo = "new value" | |
t.changed? # <== this one should be true! | |
# t.changed should be like ['foo'] |
This file contains 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
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' |
This file contains 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
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) |
This file contains 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 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 |
This file contains 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 'test_helper' | |
class OverviewControllerTest < ActionController::TestCase | |
test "should get index" do | |
get :index | |
assert_response :success | |
end | |
end |
This file contains 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 OverviewController < ApplicationController | |
def index | |
@server_list = Factory::server_list | |
@groups_by_server = Factory::groups_by_server | |
end | |
end |
OlderNewer