aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2010-07-14 15:09:47 +0200
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2010-07-19 17:15:10 +0200
commitf23b957768144994cf088cf0fabec8488d60efdf (patch)
treec898b2dc10a9974b07d633556315f2aa72f75b4d
parentClean project acceptances view (diff)
downloadrecruiting-webapp-f23b957768144994cf088cf0fabec8488d60efdf.tar.gz
recruiting-webapp-f23b957768144994cf088cf0fabec8488d60efdf.tar.bz2
recruiting-webapp-f23b957768144994cf088cf0fabec8488d60efdf.zip
Cleaned question view
Removed Questions tab. Added test for viewing questions by category.
-rw-r--r--app/controllers/questions_controller.rb2
-rw-r--r--app/views/taglibs/application.dryml1
-rw-r--r--features/question_listing.feature18
-rw-r--r--spec/controllers/questions_controller_spec.rb6
4 files changed, 25 insertions, 2 deletions
diff --git a/app/controllers/questions_controller.rb b/app/controllers/questions_controller.rb
index 3d158b3..6fd2221 100644
--- a/app/controllers/questions_controller.rb
+++ b/app/controllers/questions_controller.rb
@@ -2,7 +2,7 @@ class QuestionsController < ApplicationController
hobo_model_controller
- auto_actions :all
+ auto_actions :all, :except => :index
index_action :answered_questions, :unanswered_questions, :my_questions, :suggest_questions, :approve_questions
def answered_questions
diff --git a/app/views/taglibs/application.dryml b/app/views/taglibs/application.dryml
index 5f3cac2..c31d698 100644
--- a/app/views/taglibs/application.dryml
+++ b/app/views/taglibs/application.dryml
@@ -17,7 +17,6 @@
<def tag="main-nav">
<navigation class="main-nav" merge-attrs param="default">
<nav-item href="#{base_url}/">Home</nav-item>
- <nav-item with="&Question"><ht key="questions.nav_item">Questions</ht></nav-item>
<nav-item with="&QuestionCategory"><ht key="question_categories.nav_item">Question Categories</ht></nav-item>
<nav-item with="&QuestionGroup" action="category"><ht key="question_groups.nav_item">Question Groups</ht></nav-item>
<nav-item href="&suggest_questions_questions_path"><ht key="questions.nav_item">Suggestion Questions</ht></nav-item>
diff --git a/features/question_listing.feature b/features/question_listing.feature
index 8d3fd62..28e5bcb 100644
--- a/features/question_listing.feature
+++ b/features/question_listing.feature
@@ -24,3 +24,21 @@ Feature: Viewing question listings
|q1|q4|
And I should not see following:
|q2|q3|
+
+ Scenario: View questions by category
+ Given following questions:
+ |q1|cat1|
+ |q2|cat1|
+ |q3|cat2|
+ When I am on the home page
+ And I follow "Question Categories"
+ And I follow "cat1"
+ Then I should see following:
+ |q1|q2|
+ And I should not see "q3"
+
+ When I follow "Question Categories"
+ And I follow "cat2"
+ Then I should see "q3"
+ And I should not see following:
+ |q1|q2|
diff --git a/spec/controllers/questions_controller_spec.rb b/spec/controllers/questions_controller_spec.rb
new file mode 100644
index 0000000..79f5e67
--- /dev/null
+++ b/spec/controllers/questions_controller_spec.rb
@@ -0,0 +1,6 @@
+require 'spec_helper.rb'
+describe QuestionsController do
+ it "shold not have index" do
+ QuestionsController.action_methods.include?('index').should be_false
+ end
+end