diff --git a/app/views/notes/_note_edit_form.rhtml b/app/views/notes/_note_edit_form.rhtml
index 50834fc2..1bcd4ac8 100644
--- a/app/views/notes/_note_edit_form.rhtml
+++ b/app/views/notes/_note_edit_form.rhtml
@@ -1,8 +1,12 @@
-<% submit_text ||= t('common.update') -%>
-<% form_for(note_edit_form, :html => {
+<%
+submit_text ||= t('common.update')
+# :put for edit note and :post for new note
+form_method ||= :put
+
+form_for(note_edit_form, :html => {
:id => dom_id(note_edit_form, 'edit_form'),
:class => "inline-form edit-note-form",
- :method => :put }) do |f|
+ :method => form_method }) do |f|
-%>
<%= error_messages_for("note") %>
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb
index c338155b..263a634d 100644
--- a/app/views/projects/show.html.erb
+++ b/app/views/projects/show.html.erb
@@ -22,7 +22,7 @@
- <%= render :partial => "notes/note_edit_form", :object => @new_note, :locals => {:submit_text => t('projects.add_note_submit')} %>
+ <%= render :partial => "notes/note_edit_form", :object => @new_note, :locals => {:submit_text => t('projects.add_note_submit'), :form_method => :post} %>
diff --git a/features/context_list.feature b/features/context_list.feature
index a396da32..eef1fe1e 100644
--- a/features/context_list.feature
+++ b/features/context_list.feature
@@ -75,3 +75,8 @@ Feature: Manage the list of contexts
When I go to the contexts page
And I add a new active context "foo, bar"
Then I should see "Name cannot contain the comma"
+
+ @selenium @wip
+ Scenario: I can drag and drop to order the contexts
+ # TODO: pending scenario
+ Given this is a pending scenario
diff --git a/features/project_edit.feature b/features/project_edit.feature
index a8c2f682..7380ddba 100644
--- a/features/project_edit.feature
+++ b/features/project_edit.feature
@@ -10,6 +10,12 @@ Feature: Edit a project
And there exists a project "manage me" for user "testuser"
And I have logged in as "testuser" with password "secret"
+ Scenario: I can go to the note of a project
+ Given I have a project "test" with 2 notes
+ When I visit the "test" project
+ When I click on the first note icon
+ Then I should go to that note page
+
@selenium
Scenario: I can describe the project using markup
When I visit the "manage me" project
@@ -62,14 +68,7 @@ Feature: Edit a project
Then the badge should show 2 # "manage me" and "test"
When I try to edit the project name of "manage me" to "test"
Then I should see "Name already exists"
-
- @selenium
- Scenario: I can go to the note of a project
- Given I have a project "test" with 2 notes
- When I visit the "test" project
- When I click on the first note icon
- Then I should go to that note page
-
+
@selenium
Scenario: I can add a note to the project
Given I have a project called "test"
@@ -77,17 +76,17 @@ Feature: Edit a project
And I add a note "hello I'm testing" to the project
Then I should see one note in the project
- @selenium @focus
+ @selenium
Scenario: Cancelling adding a note to the project will remove form
Given I have a project called "test"
When I visit the "test" project
And I cancel adding a note to the project
Then the form for adding a note should not be visible
- @selenium
+ @selenium @wip
Scenario: Long notes in a project are shown cut off
Given I have a project called "test"
When I visit the "test" project
- And I add a note "test 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234 TOO LONG" to the project
- Then I should not see "test 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234 TOO LONG"
- And I should see "test 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234"
\ No newline at end of file
+ And I add a note "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890TOO LONG" to the project
+ Then I should not see "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890TOO LONG"
+ And I should see "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456"
\ No newline at end of file
diff --git a/features/step_definitions/generic_steps.rb b/features/step_definitions/generic_steps.rb
index 09aad43b..65b1439e 100644
--- a/features/step_definitions/generic_steps.rb
+++ b/features/step_definitions/generic_steps.rb
@@ -1,3 +1,7 @@
+Given /this is a pending scenario/ do
+ pending
+end
+
Then /the badge should show (.*)/ do |number|
badge = -1
xpath= "//span[@id='badge_count']"
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index 83bddc4a..c3f985ea 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -379,13 +379,6 @@ var ProjectListPage = {
update: update_order
});
});
-
- /* shrink the notes on the project pages */
- $('.note_wrapper').truncate({
- max_length: 90,
- more: '',
- less: ''
- });
}
}
@@ -633,6 +626,7 @@ function submit_with_ajax_and_block_element(form, element_to_block) {
},
complete: function() {
this.blocked_elem.unblock();
+ enable_rich_interaction();
}
});
}
@@ -857,6 +851,14 @@ function enable_rich_interaction(){
/* Reset auto updater */
field_touched = false;
+
+ /* shrink the notes on the project pages. This is not live(), so this needs
+ * to be run after ajax adding of a new note */
+ $('.note_wrapper').truncate({
+ max_length: 90,
+ more: '',
+ less: ''
+ });
}
/* Auto-refresh */