Skip to content
Browse files

Merge commit '164bc8c88bc97f0a23a8b8542f08ee9d353f5c1d' into HEAD

  • Loading branch information...
2 parents 9199075 + 164bc8c commit c77db16f6415877dd08ce1de53068609090def72 Jenkins committed Sep 12, 2012
Showing with 7 additions and 32 deletions.
  1. +2 −1 Rakefile
  2. +0 −13 lib/app.rb
  3. +0 −8 lib/validations.rb
  4. +3 −6 lib/zendesk_ticket.rb
  5. +1 −1 spec/content_form_spec.rb
  6. +1 −3 spec/page_helper.rb
View
3 Rakefile
@@ -1,8 +1,9 @@
require "rubygems"
+
task :default => "spec"
desc "Runs all tests"
task "spec" do
ruby "spec/*spec.rb"
-end
+end
View
13 lib/app.rb
@@ -19,19 +19,6 @@ class App < Sinatra::Base
end
# Content routing
- get '/new' do
- on_get("New Need", "content/new_need_message", "content/new")
- end
-
- post '/new' do
- @header = "New Need"
- @header_message = :"content/new_need_message"
- @template = "content/new"
-
- @errors = Guard.validationsForNewNeed(params)
- on_post(params, "new")
- end
-
get '/amend-content' do
on_get("Content Change", "content/content_amend_message", "content/amend")
end
View
8 lib/validations.rb
@@ -5,14 +5,6 @@ class Guard
MAX_UPLOAD_FILE_SIZE_IN_BYTE = 20971520 #20MB
#Content validations
- def self.validationsForNewNeed(form_data)
- @@errors = {}
- required = ["name", "email", "job", "department"]
- validate(form_data, required, {"phone" => form_data["phone"]}, {"email" => form_data["email"]})
-
- @@errors
- end
-
def self.validationsForAmendContent(form_data)
@@errors = {}
required = ["name", "email", "job", "department"]
View
9 lib/zendesk_ticket.rb
@@ -4,8 +4,7 @@
class ZendeskTicket
attr_reader :name, :email, :department, :job, :phone, :comment, :subject, :tag, :need_by_date, :not_before_date, :file_token
- @@in_comments = {"new" => [:additional],
- "amend-content" => [:url1, :url2, :url3],
+ @@in_comments = {"amend-content" => [:url1, :url2, :url3],
"create-user" => [:user_name, :user_email, :additional],
"remove-user" => [:user_name, :user_email, :additional],
"reset-password" => [:user_name, :user_email, :additional],
@@ -14,8 +13,7 @@ class ZendeskTicket
"publish-tool" => [:username, :url, :user_agent, :additional]
}
- @@in_subject = {"new" => "New Need",
- "amend-content" => "Content change request",
+ @@in_subject = {"amend-content" => "Content change request",
"create-user" => "Create new user",
"remove-user" => "Remove user",
"reset-password" => "Reset Password",
@@ -24,8 +22,7 @@ class ZendeskTicket
"publish-tool" => "Publishing Tool"
}
- @@in_tag = {"new" => "new_need",
- "amend-content" => "content_amend",
+ @@in_tag = {"amend-content" => "content_amend",
"create-user" => "new_user",
"remove-user" => "remove_user",
"reset-password" => "password_reset",
View
2 spec/content_form_spec.rb
@@ -48,7 +48,7 @@ def test_zendesk_create_ticket_triggered_by_post_request
ZendeskClient.expects(:raise_zendesk_request).returns("fake ticket")
#When
- post '/new', form_parameters
+ post '/create-user', form_parameters
follow_redirect!
#Then
View
4 spec/page_helper.rb
@@ -1,9 +1,7 @@
class PageHelper
def self.fill_content_form
{:url => '/temp',
- :old_content => 'test content to add',
- :new_content => 'new test content',
- :place_to_remove => 'http://testurl.com',
+ :add_content => 'test content to add',
:additional => 'additional message',
:need_by_day => '30',
:need_by_month => '12',

0 comments on commit c77db16

Please sign in to comment.
Something went wrong with that request. Please try again.