|
32 | 32 | expect(query.all.to_s).to eq "SELECT Id, name, etc FROM table_name" |
33 | 33 | end |
34 | 34 |
|
35 | | - it "should ignore dupicated attributes in select statment" do |
| 35 | + it "should ignore dupicated attributes in select statement" do |
36 | 36 | query.fields ['Id', 'name', 'etc'] |
37 | 37 | expect(query.all.to_s).to eq "SELECT Id, name, etc FROM table_name" |
38 | 38 | end |
|
43 | 43 | expect(query.where("name like '%a%'").to_s).to eq "SELECT Id, name, etc FROM table_name WHERE (name like '%a%')" |
44 | 44 | end |
45 | 45 |
|
46 | | - it "should add multiples conditions to a query with parentheses" do |
| 46 | + it "should add multiple conditions to a query with parentheses" do |
47 | 47 | expect(query.where("condition1 = 1").where("condition2 = 2 OR condition3 = 3").to_s).to eq "SELECT Id, name, etc FROM table_name WHERE (condition1 = 1) AND (condition2 = 2 OR condition3 = 3)" |
48 | 48 | end |
49 | 49 | end |
|
81 | 81 | end |
82 | 82 |
|
83 | 83 | describe ".order" do |
84 | | - it "should add a order condition in the statment" do |
| 84 | + it "should add an order condition in the statement" do |
85 | 85 | expect(query.order("name desc").to_s).to eq "SELECT Id, name, etc FROM table_name ORDER BY name desc" |
86 | 86 | end |
87 | 87 |
|
88 | | - it "should add a order condition in the statment with WHERE and LIMIT" do |
| 88 | + it "should add an order condition in the statement with WHERE and LIMIT" do |
89 | 89 | expect(query.where("condition1 = 1").order("name desc").limit(1).to_s).to eq "SELECT Id, name, etc FROM table_name WHERE (condition1 = 1) ORDER BY name desc LIMIT 1" |
90 | 90 | end |
91 | 91 | end |
|
97 | 97 | join |
98 | 98 | end |
99 | 99 |
|
100 | | - it 'should add another select statment on the current select' do |
| 100 | + it 'should add another select statement on the current select' do |
101 | 101 | expect(query.join(join_query).to_s).to eq 'SELECT Id, name, etc, (SELECT Id, name, etc FROM join_table_name) FROM table_name' |
102 | 102 | end |
103 | 103 | end |
|
0 commit comments