Skip to content

Instantly share code, notes, and snippets.

View QuBiT's full-sized avatar

Roland Guem QuBiT

  • University
  • Austria
View GitHub Profile
Feature: Search courses
In order to ensure better utilization of courses
Potential students should be able to search for courses
Scenario: Search by topic
Given there are 240 courses which do not have the topic "biology"
And there are 2 courses A001, B205 that each have "biology" as one of the topics
When I search for "biology"
Then I should see the following courses:
| Course code |
Given /^the following (.+) records?:?$/ do |factory,table|
# save all used factories and use the first table column as identifyer
@factories ||={}
@factories[factory.to_sym] ||={}
@factories[factory.to_sym][:identifyer] ||= table.headers.first
Factory::Attribute::Association.class_eval{attr_reader :factory}
associations = Factory.factory_by_name(factory).attributes.select do |attr|
attr.is_a?(Factory::Attribute::Association) && table.headers.include?(attr.name.to_s)
end
table.hashes.each do |hash|