orchestrator.executeBuild(build);
// There are 7 modules
- assertThat(count("events where category='Version'")).as("Different number of events").isEqualTo(7);
+ assertThat(count("events where category='Version'")).as("Different number of events").isEqualTo(1);
Selenese selenese = Selenese.builder()
.setHtmlTestsInClasspath("modify_version_of_multimodule_project",
access_denied unless is_admin?(snapshot)
unless params[:version_name].blank?
- if Event.already_exists(snapshot.id, params[:version_name], EventCategory::KEY_VERSION)
+ if Event.already_exists(snapshot.component_uuid, params[:version_name], EventCategory::KEY_VERSION)
flash[:error] = message('project_history.version_already_exists', :params => h(params[:version_name]))
else
# We update the snapshot to have a version attribute in sync with the new name
not_found("Snapshot not found") unless snapshot
access_denied unless is_admin?(snapshot)
- if Event.already_exists(snapshot.id, params[:event_name], EventCategory::KEY_OTHER)
+ if Event.already_exists(snapshot.component_uuid, params[:event_name], EventCategory::KEY_OTHER)
flash[:error] = message('project_history.event_already_exists', :params => h(params[:event_name]))
else
snapshots = find_project_snapshots(snapshot.id)
not_found("Event not found") unless event
access_denied unless is_admin?(event.resource)
- if Event.already_exists(event.snapshot_id, params[:event_name], EventCategory::KEY_OTHER)
+ if Event.already_exists(event.component_uuid, params[:event_name], EventCategory::KEY_OTHER)
flash[:error] = message('project_history.event_already_exists', :params => h(event.name))
else
events = find_events(event)
# exists in the history of the corresponding resource (= in any existing
# processed snapshot for this resource).
#
- def self.already_exists(snapshot_id, event_name, event_category)
- snapshot = Snapshot.find(snapshot_id.to_i)
- snapshots = Snapshot.find(:all, :conditions => ["status='P' AND component_uuid=?", snapshot.component_uuid], :include => 'events')
+ def self.already_exists(componentUuid, event_name, event_category)
+ snapshots = Snapshot.find(:all, :conditions => ["status='P' AND component_uuid=?", componentUuid], :include => 'events')
snapshots.each do |snapshot|
snapshot.events.each do |event|
return true if event.name==event_name && event.category==event_category