mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-06 09:18:50 +01:00
another set of dynamic finder migrations. All non-cucumber tests pass
This commit is contained in:
parent
64a198d45a
commit
ef91dd0c64
18 changed files with 66 additions and 66 deletions
|
|
@ -39,7 +39,7 @@ class ContextXmlApiTest < ActionController::IntegrationTest
|
|||
authenticated_post_xml_to_context_create
|
||||
assert_response 201
|
||||
end
|
||||
context1 = Context.find_by_name(@@context_name)
|
||||
context1 = Context.where(:name => @@context_name).first
|
||||
assert_not_nil context1, "expected context '#{@@context_name}' to be created"
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class ProjectXmlApiTest < ActionController::IntegrationTest
|
|||
def test_fails_with_comma_in_name
|
||||
authenticated_post_xml_to_project_create "<project><name>foo,bar</name></project>"
|
||||
assert_response :created
|
||||
project1 = Project.find_by_name("foo,bar")
|
||||
project1 = Project.where(:name => "foo,bar").first
|
||||
assert_not_nil project1, "expected project 'foo,bar' to be created"
|
||||
end
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ class ProjectXmlApiTest < ActionController::IntegrationTest
|
|||
authenticated_post_xml_to_project_create
|
||||
assert_response :created
|
||||
end
|
||||
project1 = Project.find_by_name(@@project_name)
|
||||
project1 = Project.where(:name => @@project_name).first
|
||||
assert_not_nil project1, "expected project '#{@@project_name}' to be created"
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class RecurringTodosTest < ActionController::IntegrationTest
|
|||
assert_equal 1, rt.todos.size # and it has one todo referencing it
|
||||
|
||||
# when I toggle the todo complete
|
||||
todo = Todo.find_by_recurring_todo_id(1)
|
||||
todo = Todo.where(:recurring_todo_id => 1).first
|
||||
put "/todos/#{todo.id}/toggle_check", :_source_view => 'todo'
|
||||
todo.reload
|
||||
assert todo.completed?
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class TodoXmlApiTest < ActionController::IntegrationTest
|
|||
</todo>"
|
||||
|
||||
assert_response :success
|
||||
todo = @user.todos.find_by_description("this will succeed 2.0")
|
||||
todo = @user.todos.where(:description => "this will succeed 2.0").first
|
||||
assert_not_nil todo
|
||||
assert !todo.uncompleted_predecessors.empty?
|
||||
end
|
||||
|
|
@ -76,7 +76,7 @@ class TodoXmlApiTest < ActionController::IntegrationTest
|
|||
</todo>"
|
||||
|
||||
assert_response :success
|
||||
todo = @user.todos.find_by_description("this will succeed 2.1")
|
||||
todo = @user.todos.where(:description => "this will succeed 2.1").first
|
||||
assert_not_nil todo
|
||||
assert !todo.uncompleted_predecessors.empty?
|
||||
end
|
||||
|
|
@ -95,7 +95,7 @@ class TodoXmlApiTest < ActionController::IntegrationTest
|
|||
</todo>"
|
||||
|
||||
assert_response :success
|
||||
todo = @user.todos.find_by_description("this will succeed 3")
|
||||
todo = @user.todos.where(:description => "this will succeed 3").first
|
||||
assert_not_nil todo
|
||||
assert_equal "starred, starred1, starred2", todo.tag_list
|
||||
assert todo.starred?
|
||||
|
|
@ -113,7 +113,7 @@ class TodoXmlApiTest < ActionController::IntegrationTest
|
|||
</todo>"
|
||||
|
||||
assert_response :success
|
||||
todo = @user.todos.find_by_description("this will succeed 3.1")
|
||||
todo = @user.todos.where(:description => "this will succeed 3.1").first
|
||||
assert_not_nil todo
|
||||
assert_equal "tracks", todo.tag_list
|
||||
end
|
||||
|
|
@ -133,7 +133,7 @@ class TodoXmlApiTest < ActionController::IntegrationTest
|
|||
</todo>"
|
||||
|
||||
assert_response :success
|
||||
todo = @user.todos.find_by_description("this will succeed 3")
|
||||
todo = @user.todos.where(:description => "this will succeed 3").first
|
||||
assert_not_nil todo
|
||||
assert_equal "bar, bingo, foo", todo.tag_list
|
||||
authenticated_post_xml_to_todo_create "
|
||||
|
|
@ -149,7 +149,7 @@ class TodoXmlApiTest < ActionController::IntegrationTest
|
|||
</todo>"
|
||||
|
||||
assert_response :success
|
||||
todo = @user.todos.find_by_description("this will succeed 4")
|
||||
todo = @user.todos.where(:description => "this will succeed 4").first
|
||||
assert_not_nil todo
|
||||
assert_equal "bar, bingo, foo", todo.tag_list
|
||||
end
|
||||
|
|
@ -165,7 +165,7 @@ class TodoXmlApiTest < ActionController::IntegrationTest
|
|||
</todo>"
|
||||
|
||||
assert_response :success
|
||||
todo = @user.todos.find_by_description("this will succeed 4")
|
||||
todo = @user.todos.where(:description => "this will succeed 4").first
|
||||
assert_not_nil todo
|
||||
assert_not_nil todo.context
|
||||
assert_equal todo.context.name, "@SomeNewContext"
|
||||
|
|
@ -182,7 +182,7 @@ class TodoXmlApiTest < ActionController::IntegrationTest
|
|||
</todo>"
|
||||
|
||||
assert_response :success
|
||||
todo = @user.todos.find_by_description("this will succeed 4")
|
||||
todo = @user.todos.where(:description => "this will succeed 4").first
|
||||
assert_not_nil todo
|
||||
assert_not_nil todo.context
|
||||
assert_equal contexts(:office).name, todo.context.name
|
||||
|
|
@ -200,7 +200,7 @@ class TodoXmlApiTest < ActionController::IntegrationTest
|
|||
</todo>"
|
||||
|
||||
assert_response :success
|
||||
todo = @user.todos.find_by_description("this will succeed 5")
|
||||
todo = @user.todos.where(:description => "this will succeed 5").first
|
||||
assert_not_nil todo
|
||||
assert_not_nil todo.project
|
||||
assert_equal todo.project.name, "Make even more money"
|
||||
|
|
@ -217,7 +217,7 @@ class TodoXmlApiTest < ActionController::IntegrationTest
|
|||
</todo>"
|
||||
|
||||
assert_response :success
|
||||
todo = @user.todos.find_by_description("this will succeed 5")
|
||||
todo = @user.todos.where(:description => "this will succeed 5").first
|
||||
assert_not_nil todo
|
||||
assert_not_nil todo.project
|
||||
assert_equal projects(:timemachine).name, todo.project.name
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class UsersXmlApiTest < ActionController::IntegrationTest
|
|||
authenticated_post_xml_to_user_create @@johnny_postdata
|
||||
assert_response_and_body 200, "User created."
|
||||
end
|
||||
johnny1 = User.find_by_login('johnny')
|
||||
johnny1 = User.where(:login => 'johnny').first
|
||||
assert_not_nil johnny1, "expected user johnny to be created"
|
||||
johnny2 = User.authenticate('johnny','barracuda')
|
||||
assert_not_nil johnny2, "expected user johnny to be authenticated"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue