spec/shared/structs.rb in rom-repository-0.3.1 vs spec/shared/structs.rb in rom-repository-1.0.0.beta1
- old
+ new
@@ -11,10 +11,26 @@
let(:tag_struct) do
repo.tags.mapper.model
end
+ let(:post_struct) do
+ repo.posts.mapper.model
+ end
+
+ let(:label_struct) do
+ repo.labels.mapper.model
+ end
+
+ let(:post_with_labels_struct) do
+ mapper_for(repo.posts_with_labels).model
+ end
+
+ let(:label_with_posts_struct) do
+ mapper_for(repo.label_with_posts).model
+ end
+
let(:tag_with_task_struct) do
mapper_for(repo.tag_with_wrapped_task).model
end
let(:user_with_tasks_struct) do
@@ -23,10 +39,14 @@
let(:user_with_task_struct) do
mapper_for(repo.users_with_task).model
end
+ let(:user_with_posts_struct) do
+ mapper_for(repo.users_with_posts_and_their_labels).model
+ end
+
let(:task_with_tags_struct) do
mapper_for(repo.tasks_with_tags).model
end
let(:task_with_user_struct) do
@@ -97,7 +117,26 @@
user_with_task_struct.new(id: 2, name: 'Joe', task: joe_task)
end
let(:joe_task) do
task_struct.new(id: 1, user_id: 2, title: 'Joe Task')
+ end
+
+ let(:jane_with_posts) do
+ user_with_posts_struct.new(id: 1, name: 'Jane', posts: [post_with_label])
+ end
+
+ let(:label_red) do
+ label_with_posts_struct.new(id: 1, name: 'red', post: 1)
+ end
+
+ let(:label_blue) do
+ label_with_posts_struct.new(id: 3, name: 'blue', post: 1)
+ end
+
+ let(:post_with_label) do
+ post_with_labels_struct.new(id: 2, title: 'Hello From Jane',
+ body: 'Jane Post',
+ author_id: 1,
+ labels: [label_red, label_blue])
end
end