Commit 1d34da73686b4314e818398120484bda4138f0e8
1 parent
804cafe1
Exists in
master
and in
29 other branches
ActionItem36: a first stab on a tasks controller
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1487 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
5 changed files
with
78 additions
and
0 deletions
Show diff stats
@@ -0,0 +1,22 @@ | @@ -0,0 +1,22 @@ | ||
1 | +<h2><%= _('New friend') %></h2> | ||
2 | + | ||
3 | +<p> | ||
4 | +<%= _('%s wants to connect to you as a friend.') % task.requestor.name %> | ||
5 | +</p> | ||
6 | + | ||
7 | +<% labelled_form_for('task', task, :url => { :action => 'close', :id => task.id } ) do |f| %> | ||
8 | + | ||
9 | + <div> | ||
10 | + <%= radio_button_tag(:action, 'accept', true) %> | ||
11 | + <%= _('Accept') %> | ||
12 | + </div> | ||
13 | + | ||
14 | + <div> | ||
15 | + <%= radio_button_tag(:action, 'ignore', false) %> | ||
16 | + <%= _('Ignore') %> | ||
17 | + </div> | ||
18 | + | ||
19 | + <% button_bar do %> | ||
20 | + <%= submit_button(:ok, _('OK')) %> | ||
21 | + <% end %> | ||
22 | +<% end %> |
@@ -0,0 +1,33 @@ | @@ -0,0 +1,33 @@ | ||
1 | +require File.dirname(__FILE__) + '/../test_helper' | ||
2 | +require 'tasks_controller' | ||
3 | + | ||
4 | +class TasksController; def rescue_action(e) raise e end; end | ||
5 | + | ||
6 | +class TasksControllerTest < Test::Unit::TestCase | ||
7 | + | ||
8 | + noosfero_test :profile => 'testuser' | ||
9 | + | ||
10 | + def setup | ||
11 | + @controller = TasksController.new | ||
12 | + @request = ActionController::TestRequest.new | ||
13 | + @response = ActionController::TestResponse.new | ||
14 | + | ||
15 | + self.profile = create_user('testuser').person | ||
16 | + end | ||
17 | + attr_accessor :profile | ||
18 | + | ||
19 | + should 'list pending tasks' do | ||
20 | + get :index | ||
21 | + | ||
22 | + assert_response :success | ||
23 | + assert_template 'index' | ||
24 | + assert_kind_of Array, assigns(:tasks) | ||
25 | + end | ||
26 | + | ||
27 | + should 'display form for resolving a task' | ||
28 | + | ||
29 | + should 'be able to finish a task' | ||
30 | + | ||
31 | + should 'be able to cancel a task' | ||
32 | + | ||
33 | +end |