"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/integration/api_test/time_entries_test.rb" between
redmine-4.1.0.tar.gz and redmine-4.1.1.tar.gz

About: Redmine is a flexible project management and bug-tracking web application (using the Ruby on Rails framework). It supports also project wikis and forums, documents management, and multiple version control systems.

time_entries_test.rb  (redmine-4.1.0):time_entries_test.rb  (redmine-4.1.1)
skipping to change at line 147 skipping to change at line 147
'/time_entries.xml', '/time_entries.xml',
:params => {:time_entry => {:project_id => '1', :spent_on => '2010-12-02 ', :activity_id => '11'}}, :params => {:time_entry => {:project_id => '1', :spent_on => '2010-12-02 ', :activity_id => '11'}},
:headers => credentials('jsmith')) :headers => credentials('jsmith'))
end end
assert_response :unprocessable_entity assert_response :unprocessable_entity
assert_equal 'application/xml', @response.content_type assert_equal 'application/xml', @response.content_type
assert_select 'errors error', :text => "Hours cannot be blank" assert_select 'errors error', :text => "Hours cannot be blank"
end end
test "POST /time_entries.xml with :project_id for other user" do
Role.find_by_name('Manager').add_permission! :log_time_for_other_users
entry = new_record(TimeEntry) do
post(
'/time_entries.xml',
:params =>
{:time_entry =>
{:project_id => '1', :spent_on => '2010-12-02', :user_id => '3',
:hours => '3.5', :activity_id => '11'}},
:headers => credentials('jsmith'))
end
assert_response :created
assert_equal 3, entry.user_id
assert_equal 2, entry.author_id
end
test "POST /time_entries.xml with :issue_id for other user" do
Role.find_by_name('Manager').add_permission! :log_time_for_other_users
entry = new_record(TimeEntry) do
post(
'/time_entries.xml',
:params =>
{:time_entry =>
{:issue_id => '1', :spent_on => '2010-12-02', :user_id => '3',
:hours => '3.5', :activity_id => '11'}},
:headers => credentials('jsmith'))
end
assert_response :created
assert_equal 3, entry.user_id
assert_equal 2, entry.author_id
end
test "PUT /time_entries/:id.xml with valid parameters should update time entry " do test "PUT /time_entries/:id.xml with valid parameters should update time entry " do
assert_no_difference 'TimeEntry.count' do assert_no_difference 'TimeEntry.count' do
put( put(
'/time_entries/2.xml', '/time_entries/2.xml',
:params => {:time_entry => {:comments => 'API Update'}}, :params => {:time_entry => {:comments => 'API Update'}},
:headers => credentials('jsmith')) :headers => credentials('jsmith'))
end end
assert_response :no_content assert_response :no_content
assert_equal '', @response.body assert_equal '', @response.body
assert_equal 'API Update', TimeEntry.find(2).comments assert_equal 'API Update', TimeEntry.find(2).comments
 End of changes. 1 change blocks. 
0 lines changed or deleted 34 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)