-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[api] fix pre&post check regression, they did suddenly run once, it s…
…eems class name instead of file name does matter now
- Loading branch information
1 parent
08f9de3
commit ab649fb
Showing
3 changed files
with
47 additions
and
34 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require File.expand_path(File.dirname(__FILE__) + "/..") + "/test_consistency_helper" | ||
|
||
class AAAPreConsistency < ActionController::IntegrationTest | ||
fixtures :all | ||
|
||
def test_resubmit_fixtures | ||
resubmit_all_fixtures | ||
end | ||
end | ||
|
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require File.expand_path(File.dirname(__FILE__) + "/..") + "/test_consistency_helper" | ||
|
||
class ZZZPostConsistency < ActionController::IntegrationTest | ||
fixtures :all | ||
|
||
def test_resubmit_fixtures | ||
resubmit_all_fixtures | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,46 @@ | ||
require File.expand_path(File.dirname(__FILE__) + "/..") + "/test_helper" | ||
require File.expand_path(File.dirname(__FILE__) + "/..") + "/test/test_helper" | ||
require 'source_controller' | ||
|
||
# | ||
# Add all kind of data consistency checks here. It runs before and after all functional tests | ||
# to detect any kind of data corruption due to some other code | ||
# | ||
|
||
class Consistency < ActionController::IntegrationTest | ||
fixtures :all | ||
def resubmit_all_fixtures | ||
# this just reads and writes again the meta data. 1st run the fixtures and on 2nd all left | ||
# overs from other other tests | ||
prepare_request_with_user "king", "sunflower" | ||
# projects | ||
get "/source" | ||
assert_response :success | ||
node = ActiveXML::XMLNode.new(@response.body) | ||
node.each_entry do |e| | ||
get "/source/#{e.name}/_meta" | ||
assert_response :success | ||
r = @response.body | ||
# FIXME: add some more validation checks here | ||
put "/source/#{e.name}/_meta", r.dup | ||
assert_response :success | ||
get "/source/#{e.name}/_meta" | ||
assert_response :success | ||
assert_not_nil r | ||
assert_equal r, @response.body | ||
|
||
def test_resubmit_fixtures | ||
# this just reads and writes again the meta data. 1st run the fixtures and on 2nd all left | ||
# overs from other other tests | ||
prepare_request_with_user "king", "sunflower" | ||
# projects | ||
get "/source" | ||
# packages | ||
get "/source/#{e.name}" | ||
assert_response :success | ||
node = ActiveXML::XMLNode.new(@response.body) | ||
node.each_entry do |e| | ||
get "/source/#{e.name}/_meta" | ||
packages = ActiveXML::XMLNode.new(@response.body) | ||
packages.each_entry do |p| | ||
get "/source/#{e.name}/#{p.name}/_meta" | ||
assert_response :success | ||
r = @response.body | ||
# FIXME: add some more validation checks here | ||
put "/source/#{e.name}/_meta", r.dup | ||
put "/source/#{e.name}/#{p.name}/_meta", r.dup | ||
assert_response :success | ||
get "/source/#{e.name}/_meta" | ||
get "/source/#{e.name}/#{p.name}/_meta" | ||
assert_response :success | ||
assert_not_nil r | ||
assert_equal r, @response.body | ||
|
||
# packages | ||
get "/source/#{e.name}" | ||
assert_response :success | ||
packages = ActiveXML::XMLNode.new(@response.body) | ||
packages.each_entry do |p| | ||
get "/source/#{e.name}/#{p.name}/_meta" | ||
assert_response :success | ||
r = @response.body | ||
# FIXME: add some more validation checks here | ||
put "/source/#{e.name}/#{p.name}/_meta", r.dup | ||
assert_response :success | ||
get "/source/#{e.name}/#{p.name}/_meta" | ||
assert_response :success | ||
assert_not_nil r | ||
assert_equal r, @response.body | ||
end | ||
end | ||
end | ||
end | ||
|