aboutsummaryrefslogtreecommitdiff
path: root/spec/unit
AgeCommit message (Collapse)AuthorFilesLines
2013-07-22generate a name from the server detailsGibheer1-0/+20
2013-02-27reworked the rendererGibheer6-67/+65
The renderer is now a bit smaller and asks the TemplateFinder for the actual resources. That way it can just concentrate on rendering instead of finding out, which stuff actually exists and which not.
2013-02-27reworked parts of the template finderGibheer4-8/+68
The template finder is now the instance to ask for templates. It was already looking for them, so it should be able to handle questions regarding the existence of templates too.
2013-02-12cleanup old specsGibheer1-57/+7
2013-02-12extracted the building of template treeGibheer4-5/+89
This step is a preparation to extend the functionality of the renderer. To make the main class easier, the search for templates and building of the tree is extracted into its own class.
2013-02-04rename spec for mutantGibheer1-0/+0
That kills 52 mutations!
2013-01-29catch empty routesGibheer1-0/+15
This fixes a bug where an empty route would catch all requests resulting in all routes found with the empty route.
2013-01-29make request and response staticGibheer3-32/+5
This is a step back but makes the controller work for the moment. It should be reimplemented in a better way in the future.
2013-01-28use new api of class_optionsGibheer3-12/+12
2013-01-11use class_options for the controllerGibheer3-8/+23
2013-01-11added a spec for custom parametersGibheer1-0/+4
2013-01-11split of specs for [] and []=Gibheer3-56/+97
As mutant can't use one spec file for both methods it got split up into two. I also cleaned up the tests and made them (hopefully) better readable.
2013-01-10reworked the tests to make them cleanerGibheer1-34/+68
The tests now use simple lists for the types to make it easier to distinguish between all elements. The tests themselves are also shared now.
2013-01-10Rename Zero::Request::AcceptType spec folderStormwind2-0/+0
2013-01-10Kill the last mutant in Zero::Request:AcceptTypeStormwind1-10/+11
2013-01-09take strings for bodyGibheer1-0/+27
This makes the assignment for bodies easier when using plain Strings. They get wrapped in an array as per rack definition. For every other type, they have to implement each and get directly set as body or have to be rendered to Strings first.
2013-01-06Split response_spec.rb into single test filesStormwind7-76/+111
2013-01-06Improve test structureStormwind40-0/+0
Created folder spec/unit/zero and moved all unittest into this folder.
2013-01-06Kill all mutants in Zero::RouterStormwind1-1/+6
2013-01-06Kill all mutants in Zero::RendererStormwind3-2/+23
2013-01-06Kill all mutants i Zero::RequestStormwind1-4/+4
Fix tests for PATCH, because spec_helper didn't support it and the tests where wrong. Remove if statement from "conent_type", because ruby already returns nil, if the requested key in a hash is not found. (Sounds a bit ugly, but it's true.)
2013-01-06Kill all mutants in Zero::Request::ParameterStormwind3-1/+17
I've also changed "extract_query_params" because it does not matter, if the query string it empty or not for the "parse_string" method.
2013-01-05Kill almost all mutants in Zero::Request:AcceptTypeStormwind1-6/+11
Killed 13 of 14 mutants. I will see later, how it's possible to kill the last one. I also fixed the return value of "preferred", if the in initialize given string is empty. Fixed the default value here.
2013-01-04Kill all mutants in Zero::Request::AcceptStormwind3-3/+9
2013-01-04Kill mutant in Zero::Request::ServerStormwind1-2/+10
2013-01-04Add check if body is empty on 204 and 304 in specsStormwind1-0/+2
2012-12-23Remove 1.8 fixesStormwind1-147/+0
The fixes for Ruby 1.8 will take place in a seperate gem. So I remove all the changes here.
2012-12-22Replace 'parse_query_string' with 'decode_www_form_18' in testStormwind1-21/+23
2012-12-22Renamed specfile. Will test other method here.Stormwind1-0/+0
2012-12-22Improve query valid regexStormwind1-1/+27
Now a query string cannot look like 'foo=bar=foo' anymore.
2012-12-22Add first implementation of decode_www_form_18Stormwind1-0/+8
Seperates now foo=bar&bar=foo;baz=foo queries. But does not fix url encoded strings and such things. Also added testcase for an empty query string.
2012-12-22Add patch for URI decode_www_formStormwind1-0/+111
Plus some specs. This should it make later possible to make Zero work with Ruby 1.8. But at the moment it only routes to the original decode_www_form method, if it exists. Otherwise it returns an empty Array. So this will still fail on the 1.8 versions at the moment.
2012-12-18reuse render for actual renderingGibheer1-0/+19
The splitting of rendering and processing is good, but on the other side it makes some double steps or even introduce workarounds. That is why I made the method #render just a call to the renderer. This should help much more than the strict seperation. The method will only return the resulting string and not add it to the body of the response. That still has to be taken care of by the user.
2012-12-17cleanup gemfile for jruby on travisGibheer1-0/+0
2012-12-17initialize the responseGibheer1-0/+14
2012-12-13added options to controllerGibheer1-2/+2
This avoids hardcoding the options into the controller and therefore should it make possible to use Rack::Request or Sinatra apps as requests. (That sounds so weird.)
2012-12-12replaced .create with .new on Zero::RequestGibheer3-5/+5
2012-12-10define the renderer at initializationGibheer1-1/+6
2012-12-01avoid changing existing environment keysGibheer1-0/+12
2012-11-30Optional setting of status code on redirectStormwind1-0/+8
2012-11-30Add redirect to responseStormwind1-0/+10
Now a relocation can be done, by calling redirect with the URL you want relocate to. This will set the Location header and set the status code to 302.
2012-11-30specs for the renderer accessGibheer1-0/+11
2012-11-30use URI to get parametersGibheer2-6/+20
2012-11-29don't overwrite the requestGibheer1-0/+8
2012-11-29Throws an ArgumentError, if no template fits given typesStormwind1-0/+10
2012-11-29Throws ArgumentError, if given template does not existStormwind1-0/+6
2012-11-29Add default value for default templatesStormwind1-0/+11
If a template has no type specifcation in it's name, then we use 'default' as map name now.
2012-11-29added custom parameters in the routerGibheer1-5/+18
2012-11-29added custom parameterGibheer2-0/+74
2012-11-27better specs for renderGibheer1-21/+21