From 278d7035af2de3151754a50aa535c17051edd793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BCrlimann=20=28CyT=29?= Date: Wed, 19 Nov 2014 11:29:21 +0100 Subject: [PATCH 01/34] Revert "Revert "Fix contextual_link_to and contextual_links_for calls."" This reverts commit 99f9bf59bfbc79a217337ae7b2ebf6a9ba8ba0e6. --- app/views/invoices/show.html.haml | 2 +- app/views/treatments/index.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/invoices/show.html.haml b/app/views/invoices/show.html.haml index 9dbcfe0f..5f8168b6 100644 --- a/app/views/invoices/show.html.haml +++ b/app/views/invoices/show.html.haml @@ -1,6 +1,6 @@ .contextual = icon_link_to t_title(:show, Patient), resource.patient, :icon => :show - = contextual_link_to :print, nil, :method => :post, :remote => true + = contextual_link_to :print, { :method => :post, :remote => true } = render 'show' diff --git a/app/views/treatments/index.html.haml b/app/views/treatments/index.html.haml index 4c8bb0aa..110c6a26 100644 --- a/app/views/treatments/index.html.haml +++ b/app/views/treatments/index.html.haml @@ -1,5 +1,5 @@ .contextual - = contextual_links_for :index + = contextual_links_for :action => :index = icon_link_to t_title(:new, InvoiceBatchJob), new_invoice_batch_job_path = boot_page_title From 3246d9d5d95800648a9fab98ef2fdd66fbcbdeed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BCrlimann=20=28CyT=29?= Date: Mon, 23 Feb 2015 23:35:32 +0100 Subject: [PATCH 02/34] Drop currency formatting in insurance recipe as it broke on amounts > 1000. --- app/prawn/insurance_recipe.rb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/prawn/insurance_recipe.rb b/app/prawn/insurance_recipe.rb index 0910c92b..9d2415ed 100644 --- a/app/prawn/insurance_recipe.rb +++ b/app/prawn/insurance_recipe.rb @@ -201,13 +201,13 @@ def tarmed_footer(invoice) [ "▪ " + I18n::translate(:pfl, :scope => "activerecord.attributes.invoice"), I18n::translate(:tarmed_al, :scope => "activerecord.attributes.invoice"), - currency_fmt(invoice.value_mt("001")), + invoice.amount_mt("001").currency_round, tax_points_mt(invoice, "001"), I18n::translate(:physio, :scope => "activerecord.attributes.invoice"), - currency_fmt(invoice.value("311")), + invoice.amount("311").currency_round, tax_points(invoice, "311"), I18n::translate(:mi_gel, :scope => "activerecord.attributes.invoice"), - currency_fmt(invoice.value("452")), + invoice.amount("452").currency_round, tax_points(invoice, "452"), I18n::translate(:others, :scope => "activerecord.attributes.invoice"), "0.00", @@ -216,13 +216,13 @@ def tarmed_footer(invoice) [ '', I18n::translate(:tarmed_tl, :scope => "activerecord.attributes.invoice"), - currency_fmt(invoice.value_tt("001")), + invoice.amount_tt("001").currency_round, tax_points_tt(invoice, "001"), I18n::translate(:laboratory, :scope => "activerecord.attributes.invoice"), - currency_fmt(invoice.value(["316", "317"])), + invoice.amount(["316", "317"]).currency_round, tax_points(invoice, ["316", "317"]), I18n::translate(:medi, :scope => "activerecord.attributes.invoice"), - currency_fmt(invoice.value("400")), + invoice.amount("400").currency_round, tax_points(invoice, "400"), I18n::translate(:cantonal, :scope => "activerecord.attributes.invoice"), "0.00", @@ -230,16 +230,16 @@ def tarmed_footer(invoice) ], [ {:content => "▪ " + I18n::translate(:total_amount, :scope => "activerecord.attributes.invoice"), :colspan => 2}, - currency_fmt(invoice.amount.currency_round), + invoice.amount.currency_round, '', I18n::translate(:amount_pfl, :scope => "activerecord.attributes.invoice"), - currency_fmt(invoice.obligation_amount.currency_round), + invoice.obligation_amount.currency_round, '', I18n::translate(:prepayment, :scope => "activerecord.attributes.invoice"), "0.00", '', I18n::translate(:amount_due, :scope => "activerecord.attributes.invoice"), - currency_fmt(invoice.amount.currency_round), + invoice.amount.currency_round, '' ] ] @@ -312,7 +312,7 @@ def sub_total(records) temp_cursor = cursor text_box "Zwischentotal", :style => :bold, :at => [0, temp_cursor] text_box "CHF", :at => [RECORD_INDENT, temp_cursor], :style => :bold - text_box "#{currency_fmt(records.sum(&:amount).currency_round)}", :width => 5.cm, + text_box "#{records.sum(&:amount).currency_round}", :width => 5.cm, :at => [bounds.width - 5.cm, temp_cursor], :align => :right, :style => :bold @@ -345,7 +345,7 @@ def service_entry(record) 1, 0, 0, - currency_fmt(record.amount) + record.amount ] table [data], :cell_style => {:overflow => :shrink_to_fit} do @@ -453,7 +453,7 @@ def summary(invoice) [ "0", "0.00", - currency_fmt(invoice.amount.currency_round), + invoice.amount.currency_round, "0.00" ] ] @@ -462,7 +462,7 @@ def summary(invoice) [ I18n::translate(:total, :scope => "activerecord.attributes.invoice"), '', - currency_fmt(invoice.amount.currency_round), + invoice.amount.currency_round, "0.00" ] ] From 8b80d4b075ed1ff1b0f77771c0132d5d2dd438e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BCrlimann=20=28CyT=29?= Date: Mon, 23 Feb 2015 23:36:30 +0100 Subject: [PATCH 03/34] Update CHANGELOG. --- CHANGELOG | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index cefd284f..c08e37f9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +2.0.0 (unreleased) +===== + +Fixes: +* Drop currency formatting in insurance recipe as it broke on amounts > 1000. + 2.0.0.rc8 ========= Some gems got updated, mainly Rails. The installation instructions From b6ec2bf046977834f9f36d10c19784ef4bed7916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BCrlimann=20=28CyT=29?= Date: Mon, 23 Feb 2015 23:49:15 +0100 Subject: [PATCH 04/34] Add role translations from Hozr. --- config/locales/cydoc.de-CH.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/locales/cydoc.de-CH.yml b/config/locales/cydoc.de-CH.yml index 80996ecf..cc036819 100644 --- a/config/locales/cydoc.de-CH.yml +++ b/config/locales/cydoc.de-CH.yml @@ -534,7 +534,10 @@ de-CH: admin: Administrator sysadmin: System Administration employee: Mitarbeiter + zyto: Zytologie doctor: Arzt + client: Zuweisender Arzt + flash: action: dunning_stop: Mahnstopp gesetzt From 243973e518b78233e705a8c2581166309ffdd422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BCrlimann=20=28CyT=29?= Date: Tue, 24 Feb 2015 00:12:15 +0100 Subject: [PATCH 05/34] Restrict access to bookkeeping controller actions. --- app/controllers/bookkeeping_controller.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/controllers/bookkeeping_controller.rb b/app/controllers/bookkeeping_controller.rb index c429f1be..b1e3a29e 100644 --- a/app/controllers/bookkeeping_controller.rb +++ b/app/controllers/bookkeeping_controller.rb @@ -1,7 +1,13 @@ # -*- encoding : utf-8 -*- -class BookkeepingController < ApplicationController +class BookkeepingController < AuthorizedController + skip_load_and_authorize_resource + before_filter :set_value_period + def index + authorize! :read, Account + end + def set_value_period if by_value_period = params[:by_value_period] @value_date_begin = by_value_period[:from] @@ -14,6 +20,8 @@ def set_value_period end def report + authorize! :read, Account + @total_invoiced = Account.find_by_code(current_tenant.settings['invoices.profit_account_code']).saldo(@value_date_range) @total_paid = Account.find_by_code('1000').saldo(@value_date_range) + Account.find_by_code('1020').saldo(@value_date_range) @open_items = Account.find_by_code(current_tenant.settings['invoices.balance_account_code']).saldo(@value_date_end) @@ -24,6 +32,8 @@ def report end def open_invoices + authorize! :read, Account + debit_account_id = Account.find_by_code(current_tenant.settings['invoices.balance_account_code']).id @invoices = Invoice .joins(:bookings) @@ -34,6 +44,8 @@ def open_invoices end def open_invoices_csv + authorize! :read, Account + debit_account_id = Account.find_by_code(current_tenant.settings['invoices.balance_account_code']).id @invoices = Invoice.all( :select => "invoices.*, sum(IF(bookings.debit_account_id = #{debit_account_id}, -bookings.amount, bookings.amount)) AS current_due_amount", From 400b4fbef2556a4721d0a4f24fd1da1895c7ab10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BCrlimann=20=28CyT=29?= Date: Tue, 24 Feb 2015 00:12:48 +0100 Subject: [PATCH 06/34] Update CHANGELOG. --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index c08e37f9..dd6fa86a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,9 @@ Fixes: * Drop currency formatting in insurance recipe as it broke on amounts > 1000. +* Add role translations from Hozr. +* Restrict access to bookkeeping controller actions. + 2.0.0.rc8 ========= From e68e96e8084f8387647176995f6803ca267ba75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BCrlimann=20=28CyT=29?= Date: Thu, 5 Mar 2015 17:07:59 +0100 Subject: [PATCH 07/34] Update CHANGELOG for the 2.0.0 release. --- CHANGELOG | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index dd6fa86a..3e0f91fc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,12 +1,23 @@ 2.0.0 (unreleased) ===== +This is a major release of CyDoc. It has a fresh look, better Tarmed support and +lots of small fixes. -Fixes: +We now provide more settings in the user interface, remote printing among them. +There is now a much better patient search and forms have been improved. + +We actualy rewrote most parts. Mainly porting to Rails 3, switching UI to be +built on Twitter Bootstrap, and providing fulltext search for patients +and more. + +CyDoc also uses more common code with other projects like Bookyt and Hozr +by using factored out code. + +Fixes since RC8: * Drop currency formatting in insurance recipe as it broke on amounts > 1000. * Add role translations from Hozr. * Restrict access to bookkeeping controller actions. - 2.0.0.rc8 ========= Some gems got updated, mainly Rails. The installation instructions From cad7f8347cb0f1d76bf42c3d52ab0c9cf2833544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BCrlimann=20=28CyT=29?= Date: Tue, 10 Mar 2015 23:11:13 +0100 Subject: [PATCH 08/34] Rename agpl license file to LICENSE. This is to support the very cool github license API: https://developer.github.com/v3/licenses/ --- agpl-3.0.txt => LICENSE | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename agpl-3.0.txt => LICENSE (100%) diff --git a/agpl-3.0.txt b/LICENSE similarity index 100% rename from agpl-3.0.txt rename to LICENSE From a40df7f3ac6d1c625b0f6bb2081105d3aa3813c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BCrlimann=20=28CyT=29?= Date: Mon, 29 Dec 2014 09:48:39 +0100 Subject: [PATCH 09/34] Drop unused inherited_resources_views gem. --- Gemfile | 3 --- Gemfile.lock | 3 --- 2 files changed, 6 deletions(-) diff --git a/Gemfile b/Gemfile index 9231d314..b73f1552 100644 --- a/Gemfile +++ b/Gemfile @@ -97,9 +97,6 @@ gem 'use_db' gem 'in_place_editing' gem 'select2-rails' -# CRUD helpers -gem 'inherited_resources_views' - # Authentication gem 'devise' gem 'cancan' diff --git a/Gemfile.lock b/Gemfile.lock index fec788a7..76b1f867 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -135,8 +135,6 @@ GEM inherited_resources (1.4.0) has_scope (~> 0.5.0) responders (~> 0.9) - inherited_resources_views (0.4.1) - inherited_resources (>= 1.0) journey (1.0.4) jquery-rails (2.1.3) railties (>= 3.1.0, < 5.0) @@ -317,7 +315,6 @@ DEPENDENCIES i18n_rails_helpers in_place_editing inherited_resources - inherited_resources_views jquery-rails kaminari ledermann-rails-settings From 493707a81725c24070bd1592d903f29583d67986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BCrlimann=20=28CyT=29?= Date: Fri, 2 Jan 2015 14:53:16 +0100 Subject: [PATCH 10/34] Drop zeus config. --- custom_plan.rb | 11 ----------- zeus.json | 19 ------------------- 2 files changed, 30 deletions(-) delete mode 100644 custom_plan.rb delete mode 100644 zeus.json diff --git a/custom_plan.rb b/custom_plan.rb deleted file mode 100644 index 33255640..00000000 --- a/custom_plan.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'zeus/rails' - -class CustomPlan < Zeus::Rails - - # def my_custom_command - # # see https://github.com/burke/zeus/blob/master/docs/ruby/modifying.md - # end - -end - -Zeus.plan = CustomPlan.new diff --git a/zeus.json b/zeus.json deleted file mode 100644 index 4425d49e..00000000 --- a/zeus.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "command": "ruby -rubygems -r./custom_plan -eZeus.go", - - "plan": { - "boot": { - "default_bundle": { - "development_environment": { - "prerake": {"rake": []}, - "console": ["c"], - "server": ["s"], - "generate": ["g"] - }, - "test_environment": { - "test_helper": {"test": ["rspec"]} - } - } - } - } -} From bbef6d0634d0b4a7dff361e5f4da95aca3edb405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BCrlimann=20=28CyT=29?= Date: Fri, 2 Jan 2015 14:54:25 +0100 Subject: [PATCH 11/34] Drop cucumber specs. --- Gemfile | 4 - Gemfile.lock | 9 - features/manage_patients.feature | 21 --- features/step_definitions/cydoc_steps.rb | 33 ---- features/step_definitions/patient_steps.rb | 31 ---- features/step_definitions/webrat_steps.rb | 100 ----------- features/step_definitions/welcome_steps.rb | 34 ---- features/support/env.rb | 17 -- features/support/helper.rb | 44 ----- features/support/paths.rb | 13 -- features/welcome.feature | 15 -- stories/rest_auth_stories.rb | 23 --- stories/rest_auth_stories_helper.rb | 82 ---------- stories/steps/ra_navigation_steps.rb | 50 ------ stories/steps/ra_resource_steps.rb | 180 -------------------- stories/steps/ra_response_steps.rb | 172 ------------------- stories/steps/user_steps.rb | 154 ----------------- stories/users/accounts.story | 182 --------------------- stories/users/sessions.story | 134 --------------- 19 files changed, 1298 deletions(-) delete mode 100644 features/manage_patients.feature delete mode 100644 features/step_definitions/cydoc_steps.rb delete mode 100644 features/step_definitions/patient_steps.rb delete mode 100644 features/step_definitions/webrat_steps.rb delete mode 100644 features/step_definitions/welcome_steps.rb delete mode 100644 features/support/env.rb delete mode 100644 features/support/helper.rb delete mode 100644 features/support/paths.rb delete mode 100644 features/welcome.feature delete mode 100644 stories/rest_auth_stories.rb delete mode 100644 stories/rest_auth_stories_helper.rb delete mode 100644 stories/steps/ra_navigation_steps.rb delete mode 100644 stories/steps/ra_resource_steps.rb delete mode 100644 stories/steps/ra_response_steps.rb delete mode 100644 stories/steps/user_steps.rb delete mode 100644 stories/users/accounts.story delete mode 100644 stories/users/sessions.story diff --git a/Gemfile b/Gemfile index b73f1552..0ffe7655 100644 --- a/Gemfile +++ b/Gemfile @@ -34,10 +34,6 @@ end # Test # ==== -group :test do - gem 'cucumber' -end - group :test, :development do # Console gem 'pry-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 76b1f867..79e49e4a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -77,11 +77,6 @@ GEM commonjs (0.2.6) csv-mapper (0.5.1) fastercsv - cucumber (1.2.1) - builder (>= 2.1.2) - diff-lcs (>= 1.1.3) - gherkin (~> 2.11.0) - json (>= 1.4.6) cupsffi (0.1.1) debugger (1.6.5) columnize (>= 0.3.1) @@ -94,7 +89,6 @@ GEM orm_adapter (~> 0.1) railties (~> 3.1) warden (~> 1.2.1) - diff-lcs (1.1.3) erubis (2.7.0) execjs (1.4.0) multi_json (~> 1.0) @@ -102,8 +96,6 @@ GEM ffi (1.9.3) formtastic (2.2.1) actionpack (>= 3.0) - gherkin (2.11.5) - json (>= 1.4.6) haml (4.0.4) tilt has_accounts (1.1.1) @@ -301,7 +293,6 @@ DEPENDENCIES carrierwave coffee-rails csv-mapper - cucumber cupsffi devise fastercsv diff --git a/features/manage_patients.feature b/features/manage_patients.feature deleted file mode 100644 index ac814586..00000000 --- a/features/manage_patients.feature +++ /dev/null @@ -1,21 +0,0 @@ -Feature: Manage patients - In order to keep the patient list up to date, - the doctor wants to be able to add, mutate and - delete patient information. - - Scenario: Search for a patient - Given a doctor is logged in as "test" - And I am on the new patient page - Then I should see a
containing a textfield: Suche - When I fill in "Suche" with "us_patient" - - Scenario: Lookup patient information - Given a doctor is logged in as "test" - And the following patients: - |name|sex|birth_date|doctor| - |name 1|1|1999-02-03|test| - |name 2|1|1900-01-06|test| - |name 3|0|2001-04-07|test| - |name 4|0|1899-12-31|test| -# When I am on the info page for patient "name 1" -# Then I should see "name 1" diff --git a/features/step_definitions/cydoc_steps.rb b/features/step_definitions/cydoc_steps.rb deleted file mode 100644 index addf74f5..00000000 --- a/features/step_definitions/cydoc_steps.rb +++ /dev/null @@ -1,33 +0,0 @@ -# -*- encoding : utf-8 -*- -Given /^a user "(.*)" with password "(.*)"$/ do |user, password| - User.destroy_all(:login => user) - @new_user = User.create!(:login => user, :email => "#{user}@example.com", :password => password, :password_confirmation => password ) - @new_user.register! - @new_user.activate! -end - -Given /^a doctor "(.*)" belonging to office "(.*)"/ do |doctor, office| - Given "a user \"#{doctor}\" with password \"monkey\"" - - # Doctor - Doctor.destroy_all(:login => doctor) - doctor = Doctor.create!(:login => doctor) - - # Office - Office.destroy_all(:login => office) - office = Office.create!(:login => office) - - doctor.offices << office - doctor.save! -end - -Given /^a doctor is logged in as "(.*)"$/ do |login| - Given "a doctor \"#{login}\" belonging to office \"#{login}\"" - - # Login - visit "/login" - fill_in("login", :with => login) - fill_in("password", :with => 'monkey') - click_button("Anmelden") - response.body.should =~ /Angemeldet als/m -end diff --git a/features/step_definitions/patient_steps.rb b/features/step_definitions/patient_steps.rb deleted file mode 100644 index d0e43ebf..00000000 --- a/features/step_definitions/patient_steps.rb +++ /dev/null @@ -1,31 +0,0 @@ -# -*- encoding : utf-8 -*- -Given /I am on the new patient page/ do - visit "/patients/new" -end - -When /I am on the info page for patient "(.*)"/ do |name| - visit patient_url(Patient.find_by_name(name)) -end - -Given /^the following patients:$/ do |patients| - @patients = patients.hashes - @patients.map!{|patient| patient["doctor"] = Doctor.find_by_login(patient["doctor"]); patient} - Patient.create!(@patients) -end - -When /^I delete the (\d+)(?:st|nd|rd|th) patient$/ do |pos| - visit patients_url - within("table > tr:nth-child(#{pos.to_i+1})") do - click_link "Destroy" - end -end - -Then /^I should see the following patients:$/ do |patients| - patients.raw[1..-1].each_with_index do |row, i| - row.each_with_index do |cell, j| - response.should have_selector("table > tr:nth-child(#{i+2}) > td:nth-child(#{j+1})") { |td| - td.inner_text.should == cell - } - end - end -end diff --git a/features/step_definitions/webrat_steps.rb b/features/step_definitions/webrat_steps.rb deleted file mode 100644 index 5b5b13d7..00000000 --- a/features/step_definitions/webrat_steps.rb +++ /dev/null @@ -1,100 +0,0 @@ -# -*- encoding : utf-8 -*- -require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths")) - -# Commonly used webrat steps -# http://github.com/brynary/webrat - -When /^I go to (.+)$/ do |page_name| - visit path_to(page_name) -end - -When /^I press "(.*)"$/ do |button| - click_button(button) -end - -When /^I follow "(.*)"$/ do |link| - click_link(link) -end - -When /^I fill in "(.*)" with "(.*)"$/ do |field, value| - fill_in(field, :with => value) -end - -When /^I select "(.*)" from "(.*)"$/ do |value, field| - select(value, :from => field) -end - -# Use this step in conjunction with Rail's datetime_select helper. For example: -# When I select "December 25, 2008 10:00" as the date and time -When /^I select "(.*)" as the date and time$/ do |time| - select_datetime(time) -end - -# Use this step when using multiple datetime_select helpers on a page or -# you want to specify which datetime to select. Given the following view: -# <%= f.label :preferred %>
-# <%= f.datetime_select :preferred %> -# <%= f.label :alternative %>
-# <%= f.datetime_select :alternative %> -# The following steps would fill out the form: -# When I select "November 23, 2004 11:20" as the "Preferred" data and time -# And I select "November 25, 2004 10:30" as the "Alternative" data and time -When /^I select "(.*)" as the "(.*)" date and time$/ do |datetime, datetime_label| - select_datetime(datetime, :from => datetime_label) -end - -# Use this step in conjuction with Rail's time_select helper. For example: -# When I select "2:20PM" as the time -# Note: Rail's default time helper provides 24-hour time-- not 12 hour time. Webrat -# will convert the 2:20PM to 14:20 and then select it. -When /^I select "(.*)" as the time$/ do |time| - select_time(time) -end - -# Use this step when using multiple time_select helpers on a page or you want to -# specify the name of the time on the form. For example: -# When I select "7:30AM" as the "Gym" time -When /^I select "(.*)" as the "(.*)" time$/ do |time, time_label| - select_time(time, :from => time_label) -end - -# Use this step in conjuction with Rail's date_select helper. For example: -# When I select "February 20, 1981" as the date -When /^I select "(.*)" as the date$/ do |date| - select_date(date) -end - -# Use this step when using multiple date_select helpers on one page or -# you want to specify the name of the date on the form. For example: -# When I select "April 26, 1982" as the "Date of Birth" date -When /^I select "(.*)" as the "(.*)" date$/ do |date, date_label| - select_date(date, :from => date_label) -end - -When /^I check "(.*)"$/ do |field| - check(field) -end - -When /^I uncheck "(.*)"$/ do |field| - uncheck(field) -end - -When /^I choose "(.*)"$/ do |field| - choose(field) -end - -When /^I attach the file at "(.*)" to "(.*)" $/ do |path, field| - attach_file(field, path) -end - -Then /^I should see "(.*)"$/ do |text| - response.body.should =~ /#{text}/m -end - -Then /^I should not see "(.*)"$/ do |text| - response.body.should_not =~ /#{text}/m -end - -Then /^the "(.*)" checkbox should be checked$/ do |label| - field_labeled(label).should be_checked -end diff --git a/features/step_definitions/welcome_steps.rb b/features/step_definitions/welcome_steps.rb deleted file mode 100644 index 64bed326..00000000 --- a/features/step_definitions/welcome_steps.rb +++ /dev/null @@ -1,34 +0,0 @@ -# -*- encoding : utf-8 -*- -Given "an anonymous user" do - get '/sessions/destroy' - response.should redirect_to('/session/new') - follow_redirect! -end - -Then /^I should see the following sections:$/ do |welcomes| - welcomes.raw[1..-1].each_with_index do |row, i| - row.each_with_index do |cell, j| - response.should have_selector("h3") { |td| - td.inner_text.should == cell - } - end - end -end - -# restful_authentication -# ====================== -# Shameless copy -# please note: this enforces the use of a