spec/features/action_spec.rb in rapidoc-0.0.6 vs spec/features/action_spec.rb in rapidoc-0.0.7
- old
+ new
@@ -12,13 +12,14 @@
before :all do
reset_structure
@json_info = { "user" => { "name" => "Check", "apellido" => "Me" } }
- request_file = examples_dir "users_create_request.json"
- response_file = examples_dir "users_create_response.json"
+ request_file = examples_dir "users/create_request.json"
+ response_file = examples_dir "users/create_response.json"
+ create_folders_for_files([response_file, request_file])
File.open( request_file, 'w') { |file| file.write @json_info.to_json }
File.open( response_file, 'w') { |file| file.write @json_info.to_json }
load_config
resources_doc = get_resources
@@ -26,17 +27,17 @@
@user_resource = resources_doc.select{ |r| r.name == 'users' }.first
end
after :all do
- remove_doc
+ remove_structure
remove_examples
end
- context "when visit users_index.html page" do
+ context "when visit users/index.html page" do
before do
- visit '/rapidoc/actions/users_index.html'
+ visit '/public/docs/actions/users/index.html'
end
context "when check action page" do
it "contains title with text 'Project'" do
config = YAML.load( File.read( config_file_path ) )
@@ -93,11 +94,11 @@
@params_info = @user_resource.actions_doc.first.params
end
it "have table with one row for each parameter" do
# +1 becouse rapidoc add empty row at the end
- page.should have_css( "table#table-params tr", :count => @params_info.size + 1 )
+ page.should have_css( "table#table-params tr", :count => @params_info.size + 2 )
end
it "have a row with parameter name" do
@params_info.each do |param|
page.should have_css( "table#table-params td", :text => /#{param["name"]}.*/ )
@@ -136,12 +137,12 @@
it "don't have tab 'Response'" do
page.should_not have_text( "div#response" )
end
end
- context "when visit users_create.html page" do
+ context "when visit users/create.html page" do
before do
- visit '/rapidoc/actions/users_create.html'
+ visit '/public/docs/actions/users/create.html'
end
context "when check tab 'Params'" do
before do
@create_params_info =