<commit_before>require 'spec_helper'

describe "Notes" do

  include IntegrationHelpers

  self.use_transactional_fixtures = false

  before(:each) do
    DatabaseCleaner.clean
    # FIXME - Something is not quite right with this
    Capybara.default_wait_time = 6
    sign_in user
  end

  let(:user)  {
    FactoryGirl.create :user, :email => '<EMAIL>',
                              :password => 'password'
  }

  let(:project) do
    FactoryGirl.create :project,  :name => 'Test Project',
                                  :users => [user]
  end

  let(:story) do
    FactoryGirl.create :story,  :title => 'Test Story',
                                :state => 'started',
                                :project => project,
                                :requested_by => user
  end

  describe "full story life cycle" do

    before do
      story
    end

    it "adds a note to a story", :js => true do
      visit project_path(project)

      within('#in_progress .story') do
        click_on 'Expand'
        fill_in 'note', :with => 'Adding a new note'
        click_on 'Add note'
      end

      find('#in_progress .story .notelist p.note').should have_content('Adding a new note')

    end

  end

end
<commit_msg>Fix selector in note request spec.<commit_after>require 'spec_helper'

describe "Notes" do

  include IntegrationHelpers

  self.use_transactional_fixtures = false

  before(:each) do
    DatabaseCleaner.clean
    # FIXME - Something is not quite right with this
    Capybara.default_wait_time = 6
    sign_in user
  end

  let(:user)  {
    FactoryGirl.create :user, :email => '<EMAIL>',
                              :password => 'password'
  }

  let(:project) do
    FactoryGirl.create :project,  :name => 'Test Project',
                                  :users => [user]
  end

  let(:story) do
    FactoryGirl.create :story,  :title => 'Test Story',
                                :state => 'started',
                                :project => project,
                                :requested_by => user
  end

  describe "full story life cycle" do

    before do
      story
    end

    it "adds a note to a story", :js => true do
      visit project_path(project)

      within('#in_progress .story') do
        click_on 'Expand'
        fill_in 'note', :with => 'Adding a new note'
        click_on 'Add note'
      end

      find('#in_progress .story .notelist .note').should have_content('Adding a new note')

    end

  end

end

{'fraction_non_alphanumeric': 0.09798387096774193, 'fraction_numerical': 0.0008064516129032258, 'mean_word_length': 1.8419243986254294, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7029769', 'n_tokens_mistral': 749, 'n_tokens_neox': 696, 'n_words': 215}