Skip to content

Commit

Permalink
I think we *are* handling spaces reasonably
Browse files Browse the repository at this point in the history
  • Loading branch information
pikesley committed Dec 2, 2013
1 parent 195fe70 commit d2f5856
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
16 changes: 2 additions & 14 deletions Rakefile
Expand Up @@ -9,20 +9,8 @@ Cucumber::Rake::Task.new
task :default => [:spec, :cucumber]

task :generate do
# Timecop.freeze 1970, 01, 01
@json = '{
"id": "1982",
"data": [
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0],
[0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0],
[0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0],
[0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]
}'
Timecop.freeze 1970, 01, 01
@json = '{"id":"aaa","data":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,1,1,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,0,0,0],[0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0],[0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0],[0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0],[0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]}'
@h = Pokrovsky::Historiograph.new @json
@h.user = 'pikesley'
@h.repo = 'testicicle'
Expand Down
26 changes: 25 additions & 1 deletion features/pokrovsky.feature
Expand Up @@ -8,7 +8,7 @@ Feature: get git abuse script

Scenario: Get script for a single character
Given the date is "1970-01-01"
When I go to /someuser/somerepo/a
When I go to "/someuser/somerepo/a"
Then the response should contain this text:
"""
#!/bin/bash
Expand All @@ -27,4 +27,28 @@ GIT_AUTHOR_DATE=1969-07-19T12:00:00 GIT_COMMITTER_DATE=1969-07-19T12:00:00 git c
git remote add origin git@github.com:someuser/somerepo.git
git pull
git push -u origin master
"""

Scenario: handle a space
Given the date is "2013-12-02"
When I go to "/someuser/somerepo/ROB TS"
Then the response should contain this text:
"""
GIT_AUTHOR_DATE=2012-12-24
"""
And the response should contain this text:
"""
GIT_AUTHOR_DATE=2013-02-22
"""
And the response should contain this text:
"""
GIT_AUTHOR_DATE=2013-04-17
"""
# And the response should not contain this text:
# """
#GIT_AUTHOR_DATE=2013-06-17
# """
And the response should contain this text:
"""
GIT_AUTHOR_DATE=2013-09-09
"""
8 changes: 6 additions & 2 deletions features/step_definitions/pokrovsky_steps.rb
Expand Up @@ -2,7 +2,11 @@
Timecop.freeze date
end

Then(/^the response should contain this text:$/) do |text|
page.should have_content(text)
Then(/^the response should( not)? contain this text:$/) do |boolean, text|
if boolean
page.should_not have_content(text)
else
page.should have_content(text)
end
end

3 changes: 3 additions & 0 deletions features/support/paths.rb
Expand Up @@ -16,6 +16,9 @@ def path_to(page_name)
when /someuser\/somerepo\/a/
'/someuser/somerepo/a'

when /someuser\/somerepo\/ROB TS/
'/someuser/somerepo/ROB%20TS'

# Add more mappings here.
# Here is an example that pulls values out of the Regexp:
#
Expand Down

0 comments on commit d2f5856

Please sign in to comment.