<commit_before>Given(/^there has been a past meeting$/) do
  @general_meeting = @organisation.general_meetings.make!(:past)
end

Given(/^no minutes for the past meeting have been entered yet$/) do
  @general_meeting ||= @organisation.general_meetings.past.last

  @general_meeting.update_attribute(:minutes, nil)
end

When(/^I follow "(.*?)" for the past meeting$/) do |link|
  @general_meeting ||= @organisation.general_meetings.past.last

  within("#general_meeting_#{@general_meeting.id}") do
    click_link(link)
  end
end

When(/^I choose the Members who were in attendance$/) do
  members = @organisation.members.limit(2)
  within('div.participants') do
    members.each do |member|
      fill_in("Add member", :with => member.name)
      sleep(1)
      page.execute_script("$('.ui-menu-item a:contains(\"#{member.name}\")').trigger('mouseenter').click();")
    end
  end
end

When(/^I follow "(.*?)" for the meeting$/) do |link|
  @general_meeting ||= @organisation.general_meetings.last

  within("#general_meeting_#{@general_meeting.id}") do
    click_link(link)
  end
end

Then(/^I should see the resolution in the list of resolutions to be considered at the meeting$/) do
  @resolution ||= @organisation.resolutions.last
  page.should have_css(".resolutions", :text => @resolution.title)
end

Then(/^I should see "(.*?)" for the past meeting$/) do |text|
  @general_meeting ||= @organisation.general_meetings.past.last

  within("#general_meeting_#{@general_meeting.id}") do
    page.should have_content(text)
  end
end
<commit_msg>Make JS call in step definition more robust.<commit_after>include ActionView::Helpers::JavaScriptHelper

Given(/^there has been a past meeting$/) do
  @general_meeting = @organisation.general_meetings.make!(:past)
end

Given(/^no minutes for the past meeting have been entered yet$/) do
  @general_meeting ||= @organisation.general_meetings.past.last

  @general_meeting.update_attribute(:minutes, nil)
end

When(/^I follow "(.*?)" for the past meeting$/) do |link|
  @general_meeting ||= @organisation.general_meetings.past.last

  within("#general_meeting_#{@general_meeting.id}") do
    click_link(link)
  end
end

When(/^I choose the Members who were in attendance$/) do
  members = @organisation.members.limit(2)
  within('div.participants') do
    members.each do |member|
      fill_in("Add member", :with => member.name)
      sleep(1)
      page.execute_script("$('.ui-menu-item a:contains(\"#{escape_javascript(member.name)}\")').trigger('mouseenter').click();")
    end
  end
end

When(/^I follow "(.*?)" for the meeting$/) do |link|
  @general_meeting ||= @organisation.general_meetings.last

  within("#general_meeting_#{@general_meeting.id}") do
    click_link(link)
  end
end

Then(/^I should see the resolution in the list of resolutions to be considered at the meeting$/) do
  @resolution ||= @organisation.resolutions.last
  page.should have_css(".resolutions", :text => @resolution.title)
end

Then(/^I should see "(.*?)" for the past meeting$/) do |text|
  @general_meeting ||= @organisation.general_meetings.past.last

  within("#general_meeting_#{@general_meeting.id}") do
    page.should have_content(text)
  end
end

{'fraction_non_alphanumeric': 0.14797360980207352, 'fraction_numerical': 0.0012566760917373547, 'mean_word_length': 4.768115942028985, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5894412', 'n_tokens_mistral': 1061, 'n_tokens_neox': 1034, 'n_words': 253}